-
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.
Merge remote-tracking branch 'origin/develop'
- Loading branch information
Showing
14 changed files
with
325 additions
and
29 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
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,23 @@ | ||
SHELL := /bin/bash | ||
|
||
launch: | ||
docker compose up -d | ||
|
||
dev_init: | ||
jq '.projects.geonature.architect.build.configurations.development += {"baseHref": "/geonature/"}' sources/GeoNature/frontend/angular.json > angular.json.tmp && mv angular.json.tmp sources/GeoNature/frontend/angular.json # Pas une super pratique mais pas d'autre solution pour le moment | ||
source .env; echo "{\"API_ENDPOINT\":\"//localhost$${GEONATURE_BACKEND_PREFIX}\"}" > sources/GeoNature/frontend/src/assets/config.json | ||
|
||
submodule_init: | ||
git submodule update --init --recursive | ||
|
||
build: | ||
build/build.sh | ||
|
||
dev: dev_init | ||
COMPOSE_FILE=docker-compose.yml:docker-compose-dev.yml docker compose up -d --force-recreate | ||
source .env; echo "Services de developpement lancés, vous pouvez y acceder sur : https://$${HOST}$${GEONATURE_FRONTEND_PREFIX}" | ||
|
||
prod: | ||
./init-config.sh | ||
COMPOSE_FILE=docker-compose.yml docker compose up -d | ||
source .env; echo "Services de production lancés, vous pouvez y acceder sur : https://$${HOST}$${GEONATURE_FRONTEND_PREFIX}" |
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
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
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,20 @@ | ||
ARG GEONATURE_BACKEND_IMAGE="ghcr.io/pnx-si/geonature-backend-local:latest" | ||
|
||
|
||
FROM ${GEONATURE_BACKEND_IMAGE}-wheels AS base_env | ||
WORKDIR /dist/geonature | ||
|
||
RUN rm -f geonature-* | ||
COPY --chown=${UID}:${GUID} /sources/GeoNature /sources/GeoNature | ||
COPY --chown=${UID}:${GUID} /sources/gn_module_export /sources/gn_module_export | ||
COPY --chown=${UID}:${GUID} /sources/gn_module_dashboard /sources/gn_module_dashboard | ||
COPY --chown=${UID}:${GUID} /sources/gn_module_monitoring /sources/gn_module_monitoring | ||
RUN --mount=type=cache,target=/root/.cache \ | ||
pip install *.whl sentry_sdk[flask] \ | ||
# Delete when those dependency will be added to requirements-dev | ||
RUN pip install watchdog pytest pytest-flask pytest-benchmark pip-tools | ||
RUN cd /sources/GeoNature/backend | ||
RUN pip install -r requirements-dev.txt | ||
RUN --mount=type=cache,target=/root/.cache \ | ||
pip install -e /sources/GeoNature -e /sources/gn_module_export -e /sources/gn_module_dashboard -e /sources/gn_module_monitoring \ | ||
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,13 @@ | ||
#!/bin/bash | ||
npm install | ||
|
||
# We need to install external modules dependencies | ||
if [ -d "external_modules" ]; then | ||
for dir in external_modules/*; do | ||
if [ -d "$dir" ]; then | ||
echo "Installation of dependencies $dir" | ||
(cd "$dir" && npm install) | ||
fi | ||
done | ||
fi | ||
npm run start -- --host 0.0.0.0 --port 4443 |
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,108 @@ | ||
services: | ||
|
||
#------------------------------------Builds section start-----------------------------------# | ||
base-backend: | ||
image: ${GEONATURE_BACKEND_IMAGE}-wheels | ||
build: | ||
context: sources/GeoNature | ||
dockerfile: backend/Dockerfile | ||
target: wheels | ||
entrypoint: /bin/bash -c exit | ||
|
||
base-frontend-source: | ||
image: ${GEONATURE_FRONTEND_IMAGE}-source | ||
build: | ||
context: sources/GeoNature | ||
dockerfile: frontend/Dockerfile | ||
target: source | ||
entrypoint: /bin/bash -c exit | ||
|
||
base-frontend-nginx: | ||
image: ${GEONATURE_FRONTEND_IMAGE}-nginx | ||
build: | ||
context: sources/GeoNature | ||
dockerfile: frontend/Dockerfile | ||
target: prod-base | ||
entrypoint: /bin/sh -c exit | ||
|
||
userhub-build: | ||
image: ${USERSHUB_IMAGE} | ||
build: | ||
target: prod | ||
context: sources/UsersHub | ||
volumes: | ||
- ./config/usershub:/dist/config/ | ||
entrypoint: /bin/sh -c exit | ||
#------------------------------------Builds section end------------------------------------# | ||
geonature-install-db: | ||
depends_on: | ||
base-backend: | ||
condition: service_completed_successfully | ||
build: | ||
dockerfile: build/dev/Dockerfile-geonature-backend | ||
volumes: | ||
- ./sources/GeoNature:/sources/GeoNature | ||
|
||
geonature-backend: | ||
depends_on: | ||
base-backend: | ||
condition: service_completed_successfully | ||
volumes: | ||
- ./sources/GeoNature:/sources/GeoNature | ||
- ./sources/gn_module_export:/sources/gn_module_export | ||
- ./sources/gn_module_dashboard:/sources/gn_module_dashboard | ||
- ./sources/gn_module_monitoring:/sources/gn_module_monitoring | ||
build: | ||
dockerfile: build/dev/Dockerfile-geonature-backend | ||
|
||
geonature-worker: | ||
depends_on: | ||
base-backend: | ||
condition: service_completed_successfully | ||
volumes: | ||
- ./sources/GeoNature:/sources/GeoNature | ||
- ./sources/gn_module_export:/sources/gn_module_export | ||
- ./sources/gn_module_dashboard:/sources/gn_module_dashboard | ||
- ./sources/gn_module_monitoring:/sources/gn_module_monitoring | ||
build: | ||
dockerfile: build/dev/Dockerfile-geonature-backend | ||
command: watchmedo auto-restart --directory=/sources/GeoNature --pattern=*.py --recursive -- celery -A geonature.celery_app:app worker --beat --schedule-filename=/dist/media/celerybeat-schedule.db | ||
|
||
postgres: | ||
ports: | ||
- "${POSTGRES_PORT_ON_HOST:-5432}:${POSTGRES_PORT:-5432}" | ||
|
||
traefik: | ||
command: | ||
- "--api.insecure=true" | ||
- "--providers.docker=true" | ||
- "--providers.docker.exposedbydefault=false" | ||
- "--entryPoints.web.address=:80" | ||
- "--entryPoints.web.http.redirections.entrypoint.to=:${HTTPS_PORT}" | ||
- "--entryPoints.web.http.redirections.entrypoint.scheme=https" | ||
- "--entryPoints.websecure.address=:443" | ||
- "--certificatesResolvers.acme-resolver.acme.email=${ACME_EMAIL}" | ||
- "--certificatesResolvers.acme-resolver.acme.storage=/etc/traefik/certs/acme.json" | ||
- "--certificatesResolvers.acme-resolver.acme.tlsChallenge=true" | ||
ports: | ||
- "8080:8080" | ||
|
||
geonature-frontend: | ||
depends_on: | ||
base-frontend-source: | ||
condition: service_completed_successfully | ||
build: | ||
context: . | ||
dockerfile: build/Dockerfile-geonature-frontend | ||
target: dev-extra | ||
args: | ||
GEONATURE_FRONTEND_IMAGE: ${GEONATURE_FRONTEND_IMAGE} | ||
volumes: | ||
- ./sources/GeoNature/frontend:/build | ||
- ./sources/gn_module_dashboard/frontend:/build/external_modules/dashboard | ||
- ./sources/gn_module_export/frontend:/build/external_modules/export | ||
- ./sources/gn_module_monitoring/frontend:/build/external_modules/monitorings | ||
- ./sources/GeoNature/contrib/gn_module_occhab/frontend:/build/external_modules/occhab | ||
- ./sources/GeoNature/contrib/occtax/frontend:/build/external_modules/occtax | ||
- ./sources/GeoNature/contrib/gn_module_validation/frontend:/build/external_modules/validation | ||
- ./build/dev/frontend_entrypoint.sh:/entrypoint.sh |
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
Oops, something went wrong.