diff --git a/compose.prod.yml b/compose.production.yml similarity index 82% rename from compose.prod.yml rename to compose.production.yml index 8825796e..e6f140d4 100644 --- a/compose.prod.yml +++ b/compose.production.yml @@ -1,7 +1,8 @@ # -# This file is used to define the production environment for the project. -# It is used to deploy the project on a server. -# Should not be used for local development. +# Use this configuration to deploy the project on a server. +# +# This configuration builds the frontend and backend services as Docker images, +# and uses the paths for the services, instead of ports, and enables SSL. # services: web: @@ -35,12 +36,16 @@ services: - 'traefik.http.services.api.loadbalancer.server.port=3000' db: - # Also see compose.yml + extends: + file: ./compose.yml + service: db networks: - dwengo-1 idp: - # Also see compose.yml + extends: + file: ./compose.yml + service: idp # TODO Replace with proper production command command: ['start-dev', '--http-port', '7080', '--https-port', '7443', '--import-realm'] networks: @@ -92,7 +97,15 @@ services: - dwengo-1 logging: - # Also see compose.yml + image: grafana/loki:latest + ports: + - '9001:3102' + - '9095:9095' + command: -config.file=/etc/loki/config.yaml + restart: unless-stopped + volumes: + - ./config/loki/config.yml:/etc/loki/config.yaml + - dwengo_loki_data:/loki networks: - dwengo-1 @@ -107,6 +120,7 @@ services: volumes: dwengo_grafana_data: dwengo_letsencrypt: + dwengo_loki_data: networks: dwengo-1: diff --git a/compose.override.yml b/compose.staging.yml similarity index 79% rename from compose.override.yml rename to compose.staging.yml index 5c35441e..f5081e12 100644 --- a/compose.override.yml +++ b/compose.staging.yml @@ -32,8 +32,15 @@ services: - 'traefik.http.routers.api.rule=PathPrefix(`/api`)' - 'traefik.http.services.api.loadbalancer.server.port=3000' + db: + extends: + file: ./compose.yml + service: db + idp: - # Also see compose.yml + extends: + file: ./compose.yml + service: idp labels: - 'traefik.http.routers.idp.rule=PathPrefix(`/idp`)' - 'traefik.http.services.idp.loadbalancer.server.port=7080' @@ -60,6 +67,17 @@ services: volumes: - /var/run/docker.sock:/var/run/docker.sock:ro + logging: + image: grafana/loki:latest + ports: + - '9001:3102' + - '9095:9095' + command: -config.file=/etc/loki/config.yaml + restart: unless-stopped + volumes: + - ./config/loki/config.yml:/etc/loki/config.yaml + - dwengo_loki_data:/loki + dashboards: image: grafana/grafana:latest ports: @@ -70,3 +88,6 @@ services: volumes: dwengo_grafana_data: + dwengo_loki_data: + dwengo_postgres_data: + diff --git a/compose.yml b/compose.yml index 1276c1af..9435f6f8 100644 --- a/compose.yml +++ b/compose.yml @@ -36,17 +36,5 @@ services: KC_HEALTH_ENABLED: 'true' KC_LOG_LEVEL: info - logging: - image: grafana/loki:latest - ports: - - '9001:3102' - - '9095:9095' - command: -config.file=/etc/loki/config.yaml - restart: unless-stopped - volumes: - - ./config/loki/config.yml:/etc/loki/config.yaml - - dwengo_loki_data:/loki - volumes: - dwengo_loki_data: dwengo_postgres_data: