# Use an official lightweight Python image FROM python:3.11-slim # Set environment variables ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 # Create a working directory WORKDIR /app # Install system dependencies (if needed) RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the application code COPY . . # Expose port EXPOSE 3248 # Run with Gunicorn WSGI server # Assumes your Flask app is named "app" inside "app.py" CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:3248", "app:app"]