# Use Python 3.9 slim image FROM python:3.9-slim # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ curl \ software-properties-common \ git \ && rm -rf /var/lib/apt/lists/* # Copy requirements first for better caching COPY requirements.txt ./ # Install Python dependencies RUN pip3 install --no-cache-dir -r requirements.txt # Copy application files COPY app.py ./ COPY .streamlit/ ./.streamlit/ # Create necessary directories RUN mkdir -p .streamlit # Set environment variables for Streamlit ENV STREAMLIT_SERVER_PORT=8501 ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0 ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false ENV STREAMLIT_GLOBAL_DEVELOPMENT_MODE=false # Expose the port EXPOSE 8501 # Health check HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1 # Run the application ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]