Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +17 -12
Dockerfile
CHANGED
|
@@ -1,21 +1,26 @@
|
|
| 1 |
-
FROM python:3.12.11
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
curl \
|
| 8 |
-
|
| 9 |
-
git \
|
| 10 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
-
|
| 13 |
-
COPY
|
|
|
|
| 14 |
|
| 15 |
-
|
|
|
|
| 16 |
|
|
|
|
| 17 |
EXPOSE 8501
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
|
|
|
|
|
|
| 1 |
+
FROM python:3.12.11-slim
|
| 2 |
|
| 3 |
+
# 1) Create and switch to the app directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# 2) Install system dependencies
|
| 7 |
+
RUN apt-get update && \
|
| 8 |
+
apt-get install -y build-essential curl git && \
|
| 9 |
+
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
# 3) Copy & install Python dependencies
|
| 12 |
+
COPY requirements.txt .
|
| 13 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
+
# 4) Copy all your code and data into the container
|
| 16 |
+
COPY . .
|
| 17 |
|
| 18 |
+
# 5) Expose Streamlit’s default port
|
| 19 |
EXPOSE 8501
|
| 20 |
|
| 21 |
+
# 6) Healthcheck for Streamlit
|
| 22 |
+
HEALTHCHECK --interval=30s --timeout=5s \
|
| 23 |
+
CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
| 24 |
|
| 25 |
+
# 7) Launch your app.py at root
|
| 26 |
+
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|