Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +11 -4
Dockerfile
CHANGED
|
@@ -2,6 +2,7 @@ FROM python:3.10-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
| 7 |
curl \
|
|
@@ -11,10 +12,16 @@ RUN apt-get update && apt-get install -y \
|
|
| 11 |
COPY requirements.txt ./
|
| 12 |
COPY src/ ./src/
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
|
|
|
|
| 17 |
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system dependencies yang dibutuhkan
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
build-essential \
|
| 8 |
curl \
|
|
|
|
| 12 |
COPY requirements.txt ./
|
| 13 |
COPY src/ ./src/
|
| 14 |
|
| 15 |
+
# Upgrade pip dan install requirements (ditambah upgrade numpy langsung di sini untuk jaga-jaga)
|
| 16 |
+
RUN pip3 install --no-cache-dir --upgrade pip && \
|
| 17 |
+
pip3 install --no-cache-dir -r requirements.txt && \
|
| 18 |
+
pip3 install --no-cache-dir --upgrade numpy
|
| 19 |
|
| 20 |
+
# Berikan hak akses penuh ke direktori /app (Wajib untuk Hugging Face)
|
| 21 |
+
RUN chmod -R 777 /app
|
| 22 |
|
| 23 |
+
# Hugging Face menggunakan port 7860 secara default
|
| 24 |
+
EXPOSE 7860
|
| 25 |
|
| 26 |
+
# Gunakan port 7860 untuk Streamlit
|
| 27 |
+
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|