diff --git a/Dockerfile b/Dockerfile index 270a6e096..5708d4428 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,26 @@ -FROM python:3.10-slim-bullseye +FROM python:3.10-slim-bullseye AS builder ENV PYTHONUNBUFFERED=1 -RUN apt-get update && apt-get install -y libcairo2-dev gcc +RUN apt-get update && apt-get install -y --no-install-recommends libcairo2-dev gcc && rm -rf /var/lib/apt/lists/* WORKDIR /app/ +COPY requirements.txt . +RUN pip install --no-cache-dir --prefix=/install -r requirements.txt + +FROM python:3.10-slim-bullseye AS runtime + +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app/ + +COPY --from=builder /install /usr/local + COPY . . RUN chmod +x /app/entrypoint.sh -RUN pip install -r requirements.txt - EXPOSE 8000 CMD ["python3", "manage.py", "runserver"]