Update Dockerfile
Browse files- Dockerfile +14 -19
Dockerfile
CHANGED
@@ -1,37 +1,32 @@
|
|
1 |
-
# ✅
|
2 |
-
FROM
|
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 |
-
# ✅
|
23 |
RUN pip install --upgrade pip
|
24 |
|
25 |
-
# ✅
|
26 |
-
RUN pip install torch==2.1.2 --index-url https://download.pytorch.org/whl/cu118
|
27 |
|
28 |
-
# ✅
|
29 |
COPY requirements.txt .
|
30 |
-
|
31 |
RUN pip install -r requirements.txt
|
32 |
|
33 |
-
# ✅
|
34 |
-
COPY . .
|
35 |
|
36 |
-
# ✅
|
37 |
-
CMD ["
|
|
|
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"]
|