FROM python:3.9-slim # Set working directory WORKDIR /app # Copy application files COPY app.py . COPY index.html . # Install system dependencies (for Pillow and reportlab) RUN apt-get update && apt-get install -y \ libjpeg-dev \ zlib1g-dev \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies RUN pip install --no-cache-dir flask qrcode pillow reportlab # Expose port 7860 for Hugging Face Spaces EXPOSE 7860 # Set environment variables ENV FLASK_APP=app.py ENV FLASK_ENV=production # Run the Flask app CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"]