forked from PnX-SI/GeoNature-Docker-services
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-geonature-backend
42 lines (33 loc) · 1.17 KB
/
Dockerfile-geonature-backend
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
38
39
40
41
42
ARG GEONATURE_BACKEND_IMAGE
FROM python:3.11-bookworm AS build
ENV PIP_ROOT_USER_ACTION=ignore
RUN --mount=type=cache,target=/root/.cache \
pip install --upgrade pip setuptools wheel
FROM build AS build-import
WORKDIR /build/
COPY ./sources/gn_module_import .
RUN python setup.py bdist_wheel
FROM build AS build-export
WORKDIR /build/
COPY ./sources/gn_module_export .
RUN python setup.py bdist_wheel
FROM build AS build-dashboard
WORKDIR /build/
COPY ./sources/gn_module_dashboard .
RUN python setup.py bdist_wheel
FROM build AS build-monitoring
WORKDIR /build/
COPY ./sources/gn_module_monitoring .
RUN python setup.py bdist_wheel
FROM ${GEONATURE_BACKEND_IMAGE}-wheels AS prod-extra
WORKDIR /dist/geonature
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install -y libproj-dev proj-bin
COPY --from=build-import /build/dist/*.whl .
COPY --from=build-export /build/dist/*.whl .
COPY --from=build-dashboard /build/dist/*.whl .
COPY --from=build-monitoring /build/dist/*.whl .
RUN --mount=type=cache,target=/root/.cache \
pip install *.whl sentry_sdk[flask]
RUN rm -f *.whl