Lyon28 commited on
Commit
4297f8b
·
verified ·
1 Parent(s): f9c657d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -6
Dockerfile CHANGED
@@ -1,12 +1,16 @@
 
1
  FROM python:3.9-slim
2
 
3
- WORKDIR /app
4
- COPY . .
5
 
6
- RUN pip install --no-cache-dir -r requirements.txt
 
 
7
 
8
- # Menyetel HF_HOME environment variable untuk cache model Hugging Face
9
- ENV HF_HOME /app/.cache/huggingface
10
- RUN mkdir -p /app/.cache/huggingface && chmod -R 777 /app/.cache
11
 
 
 
12
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ # Gunakan image Python resmi
2
  FROM python:3.9-slim
3
 
4
+ # Set direktori kerja
5
+ WORKDIR /code
6
 
7
+ # Salin file requirements dan install
8
+ COPY ./requirements.txt /code/requirements.txt
9
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
10
 
11
+ # Salin semua kode aplikasi kita ke dalam direktori kerja
12
+ COPY ./app /code/app
 
13
 
14
+ # Perintahkan server untuk menjalankan API kita menggunakan uvicorn
15
+ # Port 7860 adalah port standar untuk Hugging Face Spaces
16
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]