Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +4 -4
Dockerfile
CHANGED
|
@@ -11,20 +11,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 11 |
git \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
# Copy
|
| 15 |
COPY requirements.txt ./
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
-
# Copy source code and model directory
|
| 19 |
COPY src/ ./src/
|
| 20 |
COPY model/ ./model/
|
| 21 |
|
| 22 |
# Expose the Streamlit default port
|
| 23 |
EXPOSE 8501
|
| 24 |
|
| 25 |
-
# Healthcheck to monitor app readiness (optional)
|
| 26 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 27 |
CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
| 28 |
|
| 29 |
-
#
|
| 30 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
| 11 |
git \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Copy requirements and install Python dependencies first to leverage Docker cache
|
| 15 |
COPY requirements.txt ./
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
+
# Copy source code and model directory after dependencies installed
|
| 19 |
COPY src/ ./src/
|
| 20 |
COPY model/ ./model/
|
| 21 |
|
| 22 |
# Expose the Streamlit default port
|
| 23 |
EXPOSE 8501
|
| 24 |
|
| 25 |
+
# Healthcheck to monitor app readiness (optional but recommended)
|
| 26 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 27 |
CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
| 28 |
|
| 29 |
+
# Run the Streamlit app on all network interfaces on port 8501
|
| 30 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|