-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Working on integrating a developpement mode to the project. For…
… the moment it only update the backend code live while coding. See #47.
- Loading branch information
1 parent
d8d8738
commit 89d58ef
Showing
5 changed files
with
70 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
SHELL := /bin/bash | ||
|
||
prod: | ||
docker compose up -d | ||
|
||
submodule_init: | ||
git submodule init | ||
git submodule update | ||
pushd sources/GeoNature &&\ | ||
git submodule init &&\ | ||
git submodule update &&\ | ||
popd | ||
|
||
dev: submodule_init | ||
build/build.sh | ||
docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
ARG GEONATURE_BACKEND_IMAGE="ghcr.io/pnx-si/geonature-backend-local:latest" | ||
|
||
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-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 dev | ||
|
||
|
||
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 . | ||
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 | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
services: | ||
geonature-backend: | ||
volumes: | ||
- ./sources/GeoNature:/sources/GeoNature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters