File size: 1,295 Bytes
c2f15fe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
34
35
# ============================== BASE IMAGE ==============================
FROM python:3.10-slim

# ====================== SYSTEM-LEVEL DEPENDENCIES ======================
#  gcc & friends → bcrypt / uvicorn[standard] gibi C eklentilerini derlemek için
RUN apt-get update \
 && apt-get install -y --no-install-recommends gcc g++ make libffi-dev \
 && rm -rf /var/lib/apt/lists/*

# ============================== WORKDIR ================================
WORKDIR /app

# ===================== HF CACHE & WRITE PERMS ==========================
# Hugging Face Spaces özel dizinleri – yazma izni 777
RUN mkdir -p /app/.cache /tmp/.triton /tmp/torchinductor_cache \
 && chmod -R 777 /app/.cache /tmp/.triton /tmp/torchinductor_cache

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

# ============================ REQUIREMENTS =============================
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# ============================== APP CODE ===============================
COPY . .

# ============================== START CMD ==============================
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]