test-oncu / Dockerfile
ciyidogan's picture
Update Dockerfile
69deb5f verified
raw
history blame
1.14 kB
# ✅ Temel Python imajı
FROM python:3.10-slim
# ✅ Sistem bağımlılıkları (git dahil!)
RUN apt-get update && apt-get install -y gcc g++ make git
# ✅ Ç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
# ✅ Pip güncelle
RUN pip install --upgrade pip
# ✅ Uyumlu Torch + pip triton yükle
RUN pip install torch==2.1.2 torchvision --index-url https://download.pytorch.org/whl/cu118
RUN pip install triton
# ✅ Unsloth’u bağımlılıksız, doğrudan ve temiz kur
RUN pip install --upgrade --force-reinstall --no-deps --no-cache-dir unsloth unsloth_zoo
# ✅ Gereksinim dosyalarını yükle (diğer bağımlılıklar)
COPY requirements.txt .
RUN pip install -r requirements.txt
# ✅ Uygulama dosyalarını kopyala
COPY app.py .
# ✅ FastAPI uygulaması burada
CMD ["python", "app.py"]