FROM python:3.9-slim | |
WORKDIR /app | |
# Install system dependencies first | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends gcc python3-dev && \ | |
rm -rf /var/lib/apt/lists/* | |
# Install Python dependencies | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy application code | |
COPY . . | |
ENV PORT 7860 | |
EXPOSE 7860 | |
# Use the full path to gunicorn | |
CMD ["python", "-m", "gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "120", "app:app"] |