Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +14 -9
Dockerfile
CHANGED
|
@@ -1,18 +1,23 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
# Install dependencies
|
| 6 |
RUN pip install --no-cache-dir fastapi uvicorn
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
-
EXPOSE 8000
|
| 16 |
|
| 17 |
-
|
| 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"]
|
|
|