Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -8
Dockerfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
-
# Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# Install system dependencies and clean up to reduce image size
|
|
@@ -11,19 +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 |
-
COPY src/ ./src/
|
| 17 |
-
|
| 18 |
-
# Install Python dependencies
|
| 19 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
EXPOSE 8501
|
| 23 |
|
| 24 |
-
# Healthcheck to monitor app readiness
|
| 25 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 26 |
CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
| 27 |
|
| 28 |
-
#
|
| 29 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
+
# Set working directory inside the container
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
# Install system dependencies and clean up to reduce image size
|
|
|
|
| 11 |
git \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Copy requirement file and install Python dependencies
|
| 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 |
+
# Command to run the Streamlit app
|
| 30 |
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|