File size: 958 Bytes
09fc2d1
f8d9ecf
 
004a453
 
 
a56afe0
 
e910eca
a56afe0
 
 
e910eca
a56afe0
09fc2d1
 
 
a56afe0
 
 
 
 
 
f8d9ecf
09fc2d1
 
f8d9ecf
a56afe0
 
 
09fc2d1
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# === 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

# === Python kütüphaneleri yükle
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# === Uygulama dosyaları
COPY . .

# === Kullanıcıya geç
USER appuser

# === Uygulama başlatma
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]