FROM python:3.12-slim WORKDIR /app # Install dependencies first (better caching) COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . # Create data directory for persistent storage RUN mkdir -p /data # Environment variables ENV PORT=5000 ENV FLASK_ENV=production ENV DATABASE_PATH=/data/app.db EXPOSE 5000 # Run with gunicorn for production CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "app:app"]