ade-basirwfrd commited on
Commit
c421a34
·
verified ·
1 Parent(s): 8e40b24

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -9
Dockerfile CHANGED
@@ -1,18 +1,23 @@
1
- FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
  # Install dependencies
6
  RUN pip install --no-cache-dir fastapi uvicorn
7
 
8
- # Copy application files
9
- COPY . .
 
 
 
10
 
11
- # Build the index.html
12
- RUN python build.py
 
 
 
 
13
 
14
- # Expose port
15
- EXPOSE 8000
16
 
17
- # Run the server
18
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
5
  # Install dependencies
6
  RUN pip install --no-cache-dir fastapi uvicorn
7
 
8
+ # Create user for Hugging Face security
9
+ RUN useradd -m -u 1000 user
10
+ USER user
11
+ ENV HOME=/home/user \
12
+ PATH=/home/user/.local/bin:$PATH
13
 
14
+ WORKDIR /app
15
+
16
+ # Copy ALL files (termasuk folder backend/static yang berisi index.html yang sudah jadi)
17
+ COPY --chown=user . /app
18
+
19
+ # KITA HAPUS BARIS "RUN python build.py" KARENA KITA AKAN UPLOAD HASILNYA LANGSUNG
20
 
21
+ EXPOSE 7860
 
22
 
23
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]