-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
37 lines (26 loc) · 1.01 KB
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
37
FROM --platform=$BUILDPLATFORM python:3.12 as builder
RUN pip install poetry
RUN apt-get update
RUN apt-get install -y libgl1-mesa-dev ghostscript python3-tk gettext curl
# Set's up poetry caching and virtualenv configurations
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 ./
COPY gen_translations.sh ./
COPY locales/ ./locales/
RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --without dev --no-root
RUN ./gen_translations.sh
FROM --platform=$BUILDPLATFORM python:3.12 as runtime
WORKDIR /app
ENV VIRTUAL_ENV=/app/.venv \
PATH="/app/.venv/bin:$PATH"
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
COPY --from=builder /app/locales locales
COPY modul_graph ./modul_graph
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl --fail http://localhost:8080/api/v1/health || exit 1
ENTRYPOINT ["python", "-m", "modul_graph"]