rayhanzuck commited on
Commit
3ca4851
·
verified ·
1 Parent(s): f3d768e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -9
Dockerfile CHANGED
@@ -1,17 +1,18 @@
1
- # Gunakan image Python
2
- FROM python:3.9
3
 
4
- # Set direktori kerja
5
  WORKDIR /app
6
 
7
- # Salin semua file ke dalam container
8
- COPY . /app
 
9
 
10
  # Install dependencies
11
- RUN pip install -r requirements.txt
12
 
13
- # Expose port (wajib untuk Hugging Face Spaces)
14
  EXPOSE 7860
15
 
16
- # Jalankan FastAPI dengan Uvicorn
17
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Gunakan base image Python yang ringan
2
+ FROM python:3.9-slim
3
 
4
+ # Tentukan working directory
5
  WORKDIR /app
6
 
7
+ # Copy file yang diperlukan
8
+ COPY requirements.txt ./
9
+ COPY launcher.py ./
10
 
11
  # Install dependencies
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
 
14
+ # Expose port FastAPI (Hugging Face menggunakan port 7860 secara default)
15
  EXPOSE 7860
16
 
17
+ # Jalankan launcher.py untuk mengunduh dan menjalankan app.py
18
+ CMD ["python", "launcher.py"]