# Use Python 3.10 slim image FROM python:3.10-slim # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ gcc \ && rm -rf /var/lib/apt/lists/* # Copy requirements and install Python dependencies COPY requirements.txt . RUN pip install --upgrade pip && pip install -r requirements.txt # Copy application files COPY train.py . COPY app.py . # Create model directory (will be populated when training) RUN mkdir -p model # Expose port for Gradio EXPOSE 7860 # Health check HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ CMD python -c "import requests; requests.get('http://localhost:7860', timeout=10)" # Start the application CMD ["python", "app.py"]