Spaces:
Building
Building
Update Dockerfile
Browse files- Dockerfile +34 -34
Dockerfile
CHANGED
@@ -1,34 +1,34 @@
|
|
1 |
-
#
|
2 |
-
FROM python:3.10-slim
|
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 |
-
|
34 |
-
|
|
|
1 |
+
# ============================== BASE IMAGE ==============================
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# ====================== SYSTEM-LEVEL DEPENDENCIES ======================
|
5 |
+
# gcc & friends → bcrypt / uvicorn[standard] gibi C eklentilerini derlemek için
|
6 |
+
RUN apt-get update \
|
7 |
+
&& apt-get install -y --no-install-recommends gcc g++ make libffi-dev \
|
8 |
+
&& rm -rf /var/lib/apt/lists/*
|
9 |
+
|
10 |
+
# ============================== WORKDIR ================================
|
11 |
+
WORKDIR /app
|
12 |
+
|
13 |
+
# ===================== HF CACHE & WRITE PERMS ==========================
|
14 |
+
# Hugging Face Spaces özel dizinleri – yazma izni 777
|
15 |
+
RUN mkdir -p /app/.cache /tmp/.triton /tmp/torchinductor_cache \
|
16 |
+
&& chmod -R 777 /app/.cache /tmp/.triton /tmp/torchinductor_cache
|
17 |
+
|
18 |
+
ENV HF_HOME=/app/.cache \
|
19 |
+
HF_DATASETS_CACHE=/app/.cache \
|
20 |
+
HF_HUB_CACHE=/app/.cache \
|
21 |
+
TRITON_CACHE_DIR=/tmp/.triton \
|
22 |
+
TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_cache
|
23 |
+
|
24 |
+
# ============================ REQUIREMENTS =============================
|
25 |
+
COPY requirements.txt ./
|
26 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
27 |
+
|
28 |
+
# ============================== APP CODE ===============================
|
29 |
+
COPY . .
|
30 |
+
|
31 |
+
# ============================== START CMD ==============================
|
32 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
33 |
+
|
34 |
+
|