# Dockerfile for Hugging Face Spaces deployment FROM python:3.10-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ && 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 # Copy application code COPY app.py . COPY cacul.py . COPY questions_answers.csv . COPY templates/ ./templates/ # Create data directory for persistent storage RUN mkdir -p /data # Create initial empty CSV files if they don't exist RUN touch votes_results.csv model_comparison_results.csv # Expose port 7860 for Hugging Face Spaces EXPOSE 7860 # Set environment variables ENV PYTHONUNBUFFERED=1 ENV FLASK_APP=app.py # Run Flask application on port 7860 CMD ["python", "-c", "from app import app; app.run(host='0.0.0.0', port=7860, debug=False)"]