FROM python:3.10-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ git \ && rm -rf /var/lib/apt/lists/* # Copy requirements first for better caching COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application COPY . . # Create directories RUN mkdir -p uploads results # Set environment variables ENV PORT=5000 # Expose the port EXPOSE ${PORT} # Run the application with gunicorn CMD gunicorn --bind 0.0.0.0:${PORT} app:app