| |
| FROM python:3.10-slim AS builder |
|
|
| |
| WORKDIR /app |
|
|
| |
| COPY requirements.txt . |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| build-essential \ |
| libssl-dev \ |
| libffi-dev \ |
| python3-dev \ |
| && apt-get clean \ |
| && pip install --no-cache-dir --upgrade pip \ |
| && pip install --no-cache-dir -r requirements.txt |
|
|
| |
| FROM python:3.10-slim |
|
|
| |
| WORKDIR /tmp |
|
|
| |
| COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages |
| COPY --from=builder /usr/local/bin /usr/local/bin |
| COPY . . |
|
|
| |
| ENV PYTHONUNBUFFERED=1 |
| ENV MPLCONFIGDIR=/tmp/matplotlib |
|
|
| |
| RUN mkdir -p /tmp/matplotlib && chmod -R 777 /tmp/matplotlib |
|
|
| |
| EXPOSE 5000 |
|
|
| |
| CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"] |