ciyidogan commited on
Commit
0f4daf6
·
verified ·
1 Parent(s): 9c6ea3f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -19
Dockerfile CHANGED
@@ -1,37 +1,32 @@
1
- # ✅ CUDA destekli minimal imaj
2
- FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04
3
 
4
  # ✅ Sistem bağımlılıkları
5
- RUN apt-get update && apt-get install -y \
6
- python3 python3-pip git gcc g++ make \
7
- && apt-get clean
8
 
9
- # ✅ Çalışma dizini
10
  WORKDIR /app
11
-
12
- # ✅ Hugging Face Spaces cache dizinleri
13
  RUN mkdir -p /app/.cache /tmp/.triton /tmp/torchinductor_cache && chmod -R 777 /app/.cache /tmp/.triton /tmp/torchinductor_cache
14
 
15
  # ✅ Ortam değişkenleri
16
  ENV HF_HOME=/app/.cache \
 
17
  HF_HUB_CACHE=/app/.cache \
18
  TRITON_CACHE_DIR=/tmp/.triton \
19
- TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_cache \
20
- BITSANDBYTES_NOWELCOME=1
21
 
22
- # ✅ Önce pip güncelle
23
  RUN pip install --upgrade pip
24
 
25
- # ✅ Önce torch yükle (xformers ile uyumlu bir sürüm)
26
- RUN pip install torch==2.1.2 --index-url https://download.pytorch.org/whl/cu118
27
 
28
- # ✅ Sonra requirements.txt yükle
29
  COPY requirements.txt .
30
-
31
  RUN pip install -r requirements.txt
32
 
33
- # ✅ Kodları kopyala
34
- COPY . .
35
 
36
- # ✅ Başlangıç komutu
37
- CMD ["python3", "app.py"]
 
1
+ # ✅ Temel Python imajı
2
+ FROM python:3.10-slim
3
 
4
  # ✅ Sistem bağımlılıkları
5
+ RUN apt-get update && apt-get install -y gcc g++ make
 
 
6
 
7
+ # ✅ Çalışma dizini ve izinler
8
  WORKDIR /app
 
 
9
  RUN mkdir -p /app/.cache /tmp/.triton /tmp/torchinductor_cache && chmod -R 777 /app/.cache /tmp/.triton /tmp/torchinductor_cache
10
 
11
  # ✅ Ortam değişkenleri
12
  ENV HF_HOME=/app/.cache \
13
+ HF_DATASETS_CACHE=/app/.cache \
14
  HF_HUB_CACHE=/app/.cache \
15
  TRITON_CACHE_DIR=/tmp/.triton \
16
+ TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_cache
 
17
 
18
+ # ✅ Pip güncelle
19
  RUN pip install --upgrade pip
20
 
21
+ # ✅ Uyumlu Torch sürümü yükle (A100 + CUDA 11.8 için)
22
+ RUN pip install torch==2.1.2 torchvision --index-url https://download.pytorch.org/whl/cu118
23
 
24
+ # ✅ Gereksinim dosyalarını yükle
25
  COPY requirements.txt .
 
26
  RUN pip install -r requirements.txt
27
 
28
+ # ✅ Uygulama dosyalarını kopyala
29
+ COPY app.py .
30
 
31
+ # ✅ FastAPI uygulaması burada
32
+ CMD ["python", "app.py"]