-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (20 loc) · 713 Bytes
/
Dockerfile
File metadata and controls
34 lines (20 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM python:3.12-slim AS builder
RUN pip install poetry==1.8.0
ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache
WORKDIR /app
COPY pyproject.toml poetry.lock ./
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root
FROM python:3.12-slim AS runtime
ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
WORKDIR /app
EXPOSE 8000
COPY entrypoint.sh ./
RUN chmod +x /app/entrypoint.sh
COPY task_manager/ .
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["gunicorn", "task_manager.wsgi", "--workers", "4", "--bind", "0.0.0.0:8000"]