# Use official Python image FROM python:3.10-slim # Set environment variables ENV PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 \ PIP_NO_CACHE_DIR=1 # Set work directory WORKDIR /app # Copy all files into the container COPY . /app # Install system dependencies RUN apt-get update && apt-get install -y \ git \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies RUN pip install --upgrade pip RUN pip install -r requirements.txt # Expose port expected by Hugging Face EXPOSE 7860 # Run app with 4 Gunicorn workers in production mode CMD ["gunicorn", "--workers=4", "--bind=0.0.0.0:7860", "app:app"]