File size: 539 Bytes
84855fd
79ad208
 
84855fd
79ad208
 
84855fd
79ad208
84855fd
 
79ad208
 
84855fd
 
 
79ad208
84855fd
 
9c43309
84855fd
79ad208
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Gunakan Python versi ringan
FROM python:3.10-slim

# Set direktori kerja
WORKDIR /app

# Salin file dependency
COPY requirements.txt .

# Instal dependensi
RUN pip install --no-cache-dir -r requirements.txt

# Set environment variable untuk cache huggingface ke direktori yang bisa ditulis
ENV TRANSFORMERS_CACHE=/tmp/hf
ENV HF_HOME=/tmp/hf

# Salin seluruh isi project ke container
COPY . .

# Jalankan aplikasi FastAPI dengan uvicorn di port 7860 (standar Hugging Face)
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]