| FROM python:3.11-slim | |
| WORKDIR /app | |
| RUN apt-get update && apt-get install -y --no-install-recommends gcc \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY app.py . | |
| COPY gunicorn_config.py . | |
| # Runtime cache dirs | |
| RUN mkdir -p /tmp/hidden_modules_files /dev/shm/maindb | |
| ENV PORT=7860 | |
| ENV PYTHONUNBUFFERED=1 | |
| EXPOSE 7860 | |
| CMD ["gunicorn", "-c", "gunicorn_config.py", "app:app"] |