Ogghey commited on
Commit
84855fd
·
verified ·
1 Parent(s): d411917

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -6
Dockerfile CHANGED
@@ -1,16 +1,21 @@
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
5
- # Install dependensi
6
  COPY requirements.txt .
 
 
7
  RUN pip install --no-cache-dir -r requirements.txt
8
 
9
- # Salin semua file proyek
10
- COPY . .
 
11
 
12
- # Pastikan folder cache tersedia
13
- RUN mkdir -p /tmp/hf
14
 
15
- # Jalankan FastAPI di port 7860
16
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Gunakan Python versi ringan
2
  FROM python:3.10-slim
3
 
4
+ # Set direktori kerja
5
  WORKDIR /app
6
 
7
+ # Salin file dependency
8
  COPY requirements.txt .
9
+
10
+ # Instal dependensi
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
+ # Set environment variable untuk cache huggingface ke direktori yang bisa ditulis
14
+ ENV TRANSFORMERS_CACHE=/tmp/hf
15
+ ENV HF_HOME=/tmp/hf
16
 
17
+ # Salin seluruh isi project ke container
18
+ COPY . .
19
 
20
+ # Jalankan aplikasi FastAPI dengan uvicorn di port 7860 (standar Hugging Face)
21
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]