From fe2445cfdc30339f3b40071dffc9f34baed0655d Mon Sep 17 00:00:00 2001 From: VincentCauchois Date: Wed, 24 Apr 2024 17:51:54 +0200 Subject: [PATCH] [WIP]: feat(mode-dev-docker): add a mode dev for geonature-frontend Add a `docker-compose.dev.yml` file that may be used for dev mode. Launch the stack with the following command: `docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d` [WIP]: - Fix Traefik routing rules for dev mode --- docker-compose.dev.yml | 14 ++++++++++++++ docker-compose.yml | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 docker-compose.dev.yml diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..4175ed3 --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,14 @@ +services: + geonature-frontend: + build: + context: . + dockerfile: build/Dockerfile-geonature-frontend + target: source-extra + args: + GEONATURE_FRONTEND_IMAGE: ghcr.io/pnx-si/geonature-frontend:latest + working_dir: /build/src/app + command: npm run start -- --host 0.0.0.0 + expose: + - 4200 + volumes: + - ./sources/GeoNature/frontend/src:/build/src \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 5e5fdb9..9d5be2d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -193,7 +193,7 @@ services: - API_ENDPOINT="${GEONATURE_BACKEND_PROTOCOL}://${GEONATURE_BACKEND_HOSTPORT}${GEONATURE_BACKEND_PREFIX}" labels: - "traefik.enable=true" - - "traefik.http.routers.geonature.rule=Host(`${GEONATURE_FRONTEND_HOST}`) && PathPrefix(`${GEONATURE_FRONTEND_PREFIX}`)" + - "traefik.http.routers.geonature.rule=Host(`${GEONATURE_FRONTEND_HOST}`) && ( PathPrefix(`${GEONATURE_FRONTEND_PREFIX}`) || PathPrefix(`/{file:[^/]+\\.[^/]+}`) || PathPrefix(`/assets/config.json`))" - "traefik.http.routers.geonature.entrypoints=websecure" - "traefik.http.routers.geonature.tls.certResolver=acme-resolver"