Spaces:
Sleeping
Sleeping
Redefining Dockerfile for styling configurations
Browse files- Dockerfile +13 -7
Dockerfile
CHANGED
|
@@ -1,27 +1,33 @@
|
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
| 7 |
curl \
|
| 8 |
git \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
|
|
|
| 13 |
|
| 14 |
# Copy project files
|
| 15 |
COPY . .
|
| 16 |
|
| 17 |
-
# Copy Streamlit config
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
ENV STREAMLIT_CONFIG_PATH=/app/.streamlit/config.toml
|
| 22 |
|
|
|
|
| 23 |
EXPOSE 8501
|
| 24 |
|
|
|
|
| 25 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
| 26 |
|
|
|
|
| 27 |
ENTRYPOINT ["streamlit", "run", "KPI_Dashboard.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
| 1 |
+
# Use official lightweight Python image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Install system dependencies
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
build-essential \
|
| 10 |
curl \
|
| 11 |
git \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Copy and install Python dependencies
|
| 15 |
+
COPY requirements.txt .
|
| 16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
# Copy project files
|
| 19 |
COPY . .
|
| 20 |
|
| 21 |
+
# Copy Streamlit config to home directory (ensures theme & styling work)
|
| 22 |
+
RUN mkdir -p /root/.streamlit \
|
| 23 |
+
&& cp -r .streamlit/* /root/.streamlit/ \
|
| 24 |
+
&& chmod 600 /root/.streamlit/config.toml
|
|
|
|
| 25 |
|
| 26 |
+
# Expose Streamlit port
|
| 27 |
EXPOSE 8501
|
| 28 |
|
| 29 |
+
# Healthcheck for Hugging Face Spaces
|
| 30 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
| 31 |
|
| 32 |
+
# Run Streamlit
|
| 33 |
ENTRYPOINT ["streamlit", "run", "KPI_Dashboard.py", "--server.port=8501", "--server.address=0.0.0.0"]
|