Spaces:
Paused
Paused
# === Temel Python imajı | |
FROM python:3.10-slim | |
# === Gerekli sistem bağımlılıkları (C derleyicisi dahil) | |
RUN apt-get update && apt-get install -y gcc g++ make | |
# === UID 1000 kullanıcı ekle (bazı Torch hataları için) | |
RUN adduser --uid 1000 --disabled-password --gecos '' appuser | |
# === Çalışma dizini ve izinler | |
WORKDIR /app | |
RUN mkdir -p /app/.cache /tmp/.triton /tmp/torchinductor_cache && chmod -R 777 /app/.cache /tmp/.triton /tmp/torchinductor_cache | |
# === Ortam değişkenleri | |
ENV HF_HOME=/app/.cache \ | |
HF_DATASETS_CACHE=/app/.cache \ | |
HF_HUB_CACHE=/app/.cache \ | |
TRITON_CACHE_DIR=/tmp/.triton \ | |
TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_cache | |
# === Gereken dosyaları kopyala | |
COPY . . | |
# === Requirements yükleme | |
COPY requirements.txt ./ | |
RUN pip install --no-cache-dir -r requirements.txt | |
# === Hugging Face Spaces özel dizinleri (izin ayarları) | |
RUN mkdir -p /data/chunks /data/tokenized_chunks && chmod -R 777 /data | |
# === Uygulama başlatma | |
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |