From 5639cd388f2640cda0954cb494c5562a2a40c8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Placzy=C5=84ski?= Date: Thu, 25 Apr 2024 06:51:52 +0200 Subject: [PATCH] [#849] Add analytics-dashboard service to Docker Compose Include a new service, analytics-dashboard, in the Docker Compose configuration file located at scripts/govtool/config/templates/docker-compose.yml.tpl. This addition introduces the analytics-dashboard service to the existing setup, allowing the service to be deployed as part of the infrastructure. The analytics-dashboard service is configured with necessary environment variables such as NEXT_PUBLIC_GA4_PROPERTY_ID, GOOGLE_APPLICATION_CREDENTIALS, GA_CLIENT_EMAIL, GA_PRIVATE_KEY, SENTRY_IGNORE_API_RESOLUTION_ERROR, and NEXT_PUBLIC_API_URL to enable proper functionality. The service's health is monitored through defined health check parameters, ensuring its stability within the deployment environment. By integrating the analytics-dashboard service into the Docker Compose setup, the infrastructure aligns with the user story's goal of configuring the sanchogov.tools sub-domain for the analytics service. --- .../config/templates/docker-compose.yml.tpl | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/govtool/config/templates/docker-compose.yml.tpl b/scripts/govtool/config/templates/docker-compose.yml.tpl index 742d0f970..50e42559e 100644 --- a/scripts/govtool/config/templates/docker-compose.yml.tpl +++ b/scripts/govtool/config/templates/docker-compose.yml.tpl @@ -209,6 +209,29 @@ services: - "traefik.http.services.metadata-validation.loadbalancer.healthcheck.interval=10s" - "traefik.http.services.metadata-validation.loadbalancer.healthcheck.timeout=5s" + analytics-dashboard: + image: /analytics-dashboard:${ANALYTICS_DASHBOARD_TAG} + environment: + - NEXT_PUBLIC_GA4_PROPERTY_ID=${NEXT_PUBLIC_GA4_PROPERTY_ID} + - GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS} + - GA_CLIENT_EMAIL=${GA_CLIENT_EMAIL} + - GA_PRIVATE_KEY=${GA_PRIVATE_KEY} + - SENTRY_IGNORE_API_RESOLUTION_ERROR=${SENTRY_IGNORE_API_RESOLUTION_ERROR} + - NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL} + logging: *logging + restart: always + healthcheck: + test: ["CMD-SHELL", "curl -f 127.0.0.1:3000/ || exit 1"] + interval: 5s + timeout: 5s + retries: 5 + labels: + - "traefik.enable=true" + - "traefik.http.routers.to-metadata-validation.rule=Host(`participation.`)" + - "traefik.http.routers.to-metadata-validation.entrypoints=websecure" + - "traefik.http.routers.to-metadata-validation.tls.certresolver=myresolver" + - "traefik.http.services.metadata-validation.loadbalancer.server.port=3000" + backend: image: /backend:${BACKEND_TAG} command: /usr/local/bin/vva-be -c /run/secrets/backend-config.json start-app