Kenya-Risk-Dashboard / Dockerfile
aadhavans's picture
Adjusting folder structure
be7bb59
# Base image
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python packages
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy app source code
COPY . .
# Create necessary folders with full permissions
RUN mkdir -p /app/.streamlit \
/app/.config/matplotlib \
/app/.cache \
/app/outputs \
&& chmod -R 777 /app/.streamlit \
/app/.config \
/app/.cache \
/app/outputs \
/tmp
# Copy Streamlit config
COPY .streamlit/config.toml /app/.streamlit/config.toml
# Set environment variable for Matplotlib to use writable directory
ENV MPLCONFIGDIR=/app/.config/matplotlib
# Expose Streamlit default port
EXPOSE 8501
# Start Streamlit with KPI_Dashboard.py as the main page
CMD ["streamlit", "run", "KPI_Dashboard.py", "--server.port=8501", "--server.address=0.0.0.0"]