Skip to content

Commit

Permalink
[WIP] Deleted duplicate docker file. Create a dev target in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe-Ramet committed Jan 14, 2025
1 parent c0ca1b5 commit 8f47ff4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 49 deletions.
17 changes: 14 additions & 3 deletions build/Dockerfile-geonature-backend
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,27 @@ WORKDIR /build/
COPY ./sources/gn_module_monitoring .
RUN python setup.py bdist_wheel

FROM ${GEONATURE_BACKEND_IMAGE}-wheels AS prod-extra


FROM ${GEONATURE_BACKEND_IMAGE}-wheels AS base_env
WORKDIR /dist/geonature
RUN --mount=type=cache,target=/var/cache/apt \
--mount=type=cache,target=/var/lib/apt \
apt-get update && apt-get install -y libproj-dev proj-bin
COPY --from=build-export /build/dist/*.whl .
COPY --from=build-dashboard /build/dist/*.whl .
COPY --from=build-monitoring /build/dist/*.whl .


FROM base_env AS dev
RUN rm -f geonature-*
COPY --chown=${UID}:${GUID} /sources/GeoNature /sources/GeoNature
RUN --mount=type=cache,target=/root/.cache \
pip install -e /sources/GeoNature
RUN --mount=type=cache,target=/root/.cache \
pip install *.whl sentry_sdk[flask]
RUN rm -f *.whl


FROM base_env AS prod-extra
RUN --mount=type=cache,target=/root/.cache \
pip install *.whl sentry_sdk[flask]
RUN rm -f *.whl
44 changes: 0 additions & 44 deletions build/dev/Dockerfile-geonature-backend

This file was deleted.

6 changes: 4 additions & 2 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ services:
volumes:
- ./sources/GeoNature:/sources/GeoNature
build:
dockerfile: build/dev/Dockerfile-geonature-backend
dockerfile: build/Dockerfile-geonature-backend
target: dev

geonature-worker:
depends_on:
base-backend:
condition: service_completed_successfully
build:
dockerfile: build/dev/Dockerfile-geonature-backend
dockerfile: build/Dockerfile-geonature-backend
target: dev

geonature-frontend:
depends_on:
Expand Down

0 comments on commit 8f47ff4

Please sign in to comment.