Skip to content

Commit

Permalink
[#849] Add analytics-dashboard service to Docker Compose
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
placek committed Apr 25, 2024
1 parent cae1aad commit 5639cd3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions scripts/govtool/config/templates/docker-compose.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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: <REPO_URL>/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.<DOMAIN>`)"
- "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: <REPO_URL>/backend:${BACKEND_TAG}
command: /usr/local/bin/vva-be -c /run/secrets/backend-config.json start-app
Expand Down

0 comments on commit 5639cd3

Please sign in to comment.