-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (22 loc) · 769 Bytes
/
Dockerfile
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
35
36
FROM python:3.12-slim-bullseye AS base
WORKDIR /opt
ENV PYTHONDONTWRITEBYTECODE=off
ENV PYTHONFAULTHANDLER=on
ENV PYTHONUNBUFFERED=on
RUN pip install poetry==1.8.3 \
&& poetry config virtualenvs.create true \
&& poetry config virtualenvs.in-project true
COPY pyproject.toml poetry.lock ./
COPY packages packages
RUN poetry install --only main --no-interaction --no-ansi --no-root --no-cache
FROM base AS dev
WORKDIR /opt/dev
ENV PATH="/opt/.venv/bin:$PATH"
RUN poetry install --no-interaction --no-ansi --no-root --no-cache \
&& poetry config virtualenvs.create false
FROM python:3.12-slim-bullseye AS prod
WORKDIR /opt
ENV PATH="/opt/.venv/bin:$PATH"
COPY --from=base /opt/.venv .venv
COPY app app
CMD ["python", "-m", "app", "server", "up"]