# Use an official Python runtime as a parent image FROM python:3.9-slim # Set the working directory in the container WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ curl \ software-properties-common \ python3-dev \ && rm -rf /var/lib/apt/lists/* # Copy the requirements file into the container COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Create necessary directories RUN mkdir -p app/pages config data grafana logs /root/.streamlit # Set Python path and Streamlit configs ENV PYTHONPATH=/app \ STREAMLIT_BROWSER_GATHER_USAGE_STATS=false \ STREAMLIT_THEME_PRIMARY_COLOR="#FF4B4B" \ STREAMLIT_SERVER_PORT=8501 \ STREAMLIT_SERVER_ADDRESS=0.0.0.0 # Create empty __init__.py files RUN touch app/__init__.py app/pages/__init__.py # Copy the application code and other files into the container COPY app/ ./app/ COPY data/ ./data/ COPY grafana/ ./grafana/ CMD ["streamlit", "run", "app/home.py", "--server.port=7860", "--server.address=0.0.0.0"]