| # ---- base image ---- | |
| FROM python:3.11-slim | |
| # Make output unbuffered (logs show up immediately) | |
| ENV PYTHONUNBUFFERED=1 | |
| # Create app directory | |
| WORKDIR /app | |
| # Install system deps only if you need them (uncomment as needed) | |
| # RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| # build-essential && \ | |
| # rm -rf /var/lib/apt/lists/* | |
| # ---- python deps ---- | |
| # Install Python deps first for better layer caching | |
| COPY requirements.txt /app/requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # ---- app code ---- | |
| COPY . /app | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY . . | |
| CMD ["gunicorn","-b","0.0.0.0:7860","app:app"] |