# Use Python 3.11 slim image for smaller size FROM python:3.11-slim # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ gcc \ g++ \ && rm -rf /var/lib/apt/lists/* # Copy requirements first for better caching COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Install additional dependencies for Hugging Face datasets RUN pip install --no-cache-dir datasets huggingface_hub # Copy application files COPY streamlit_app.py . COPY constants.py . COPY vaill_logo.png . # Copy backend modules COPY user_management.py . COPY huggingface_upload.py . COPY update_streamlit_panel.py . COPY update_data.py . COPY data_updating_scripts ./data_updating_scripts # Copy Streamlit pages COPY pages/ ./pages/ # Copy data folder COPY data/ ./data/ # Expose port EXPOSE 8501 # Set environment variables ENV PYTHONPATH=/app ENV STREAMLIT_SERVER_PORT=8501 ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0 # Health check HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health # Run the app CMD ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]