From 1261ae74e74bc4ce38617a2fa5bebde563746e68 Mon Sep 17 00:00:00 2001 From: jbregstone Date: Fri, 14 Apr 2023 16:44:55 -0400 Subject: [PATCH 1/2] changes to yaml format --- app/src/docker/docker-compose.yml | 110 +++++++++--------------------- 1 file changed, 32 insertions(+), 78 deletions(-) diff --git a/app/src/docker/docker-compose.yml b/app/src/docker/docker-compose.yml index e0ef56fb11..6c713c1fc4 100644 --- a/app/src/docker/docker-compose.yml +++ b/app/src/docker/docker-compose.yml @@ -150,8 +150,7 @@ services: app: image: va/abd_vro-app:latest - <<: *common-security-opt - <<: *common-sde-security + <<: [*common-sde-security, *common-security-opt] hostname: app ports: - "8080:8080" @@ -159,11 +158,7 @@ services: environment: # ENV=local causes application-local.yml (and application-nonprod.yml) to be used, in addition to the default application.yml # PERSIST_TRACKING_FOLDER is necessary for local testing when ENV=dev or qa - <<: *common-vars - <<: *rabbitmq-placeholder-vars - <<: *redis-placeholder-vars - <<: *postgres-vars - <<: *mas-vars + <<: [*mas-vars, *postgres-vars, *redis-placeholder-vars, *rabbitmq-placeholder-vars, *common-vars] PERSIST_TRACKING_FOLDER: /persist/tracking BIP_CLAIM_USERID: ${BIP_CLAIM_USERID} BIP_CLAIM_SECRET: ${BIP_CLAIM_SECRET} @@ -192,13 +187,10 @@ services: xample-workflows: image: va/abd_vro-xample-workflows:latest - <<: *common-security-opt - <<: *common-sde-security + <<: [*common-sde-security, *common-security-opt] profiles: ["all","xample"] environment: - <<: *redis-placeholder-vars - <<: *rabbitmq-placeholder-vars - <<: *postgres-vars + <<: [*postgres-vars, *rabbitmq-placeholder-vars, *redis-placeholder-vars] depends_on: postgres-service: condition: service_healthy @@ -209,12 +201,10 @@ services: svc-xample-j: image: va/abd_vro-svc-xample-j:latest - <<: *common-security-opt - <<: *common-sde-security + <<: [*common-sde-security, *common-security-opt] profiles: ["all","svc","xample"] environment: - <<: *rabbitmq-placeholder-vars - <<: *rabbitmq-client-vars + <<: [*rabbitmq-client-vars, *rabbitmq-placeholder-vars] depends_on: rabbitmq-service: condition: service_healthy @@ -224,12 +214,9 @@ services: svc-assessor-dc7101: profiles: ["all","svc","assessor","v2"] image: va/abd_vro-assessclaimdc7101:latest - <<: *common-security-opt - <<: *common-sde-security - <<: *python-healthcheck + <<: [*python-healthcheck, *common-sde-security, *common-security-opt] environment: - <<: *rabbitmq-placeholder-vars - <<: *rabbitmq-client-vars + <<: [*rabbitmq-client-vars, *rabbitmq-placeholder-vars] depends_on: rabbitmq-service: condition: service_healthy @@ -239,12 +226,9 @@ services: svc-assessor-dc6602: profiles: ["all","svc","assessor","v2"] image: va/abd_vro-assessclaimdc6602:latest - <<: *common-security-opt - <<: *common-sde-security - <<: *python-healthcheck + <<: [*python-healthcheck, *common-sde-security, *common-security-opt] environment: - <<: *rabbitmq-placeholder-vars - <<: *rabbitmq-client-vars + <<: [*rabbitmq-client-vars, *rabbitmq-placeholder-vars] depends_on: rabbitmq-service: condition: service_healthy @@ -254,12 +238,9 @@ services: svc-assessor-dc6602v2: profiles: ["all","svc","assessor","prototype"] image: va/abd_vro-assessclaimdc6602v2:latest - <<: *common-security-opt - <<: *common-sde-security - <<: *python-healthcheck + <<: [*python-healthcheck, *common-sde-security, *common-security-opt] environment: - <<: *rabbitmq-placeholder-vars - <<: *rabbitmq-client-vars + <<: [*rabbitmq-client-vars, *rabbitmq-placeholder-vars] depends_on: rabbitmq-service: condition: service_healthy @@ -269,12 +250,9 @@ services: svc-assessor-cancer: profiles: ["all","svc","assessor","prototype"] image: va/abd_vro-assessclaimcancer:latest - <<: *common-security-opt - <<: *common-sde-security - <<: *python-healthcheck + <<: [*python-healthcheck, *common-sde-security, *common-security-opt] environment: - <<: *rabbitmq-placeholder-vars - <<: *rabbitmq-client-vars + <<: [*rabbitmq-client-vars, *rabbitmq-placeholder-vars] depends_on: rabbitmq-service: condition: service_healthy @@ -284,12 +262,9 @@ services: svc-assessor-dc6510: profiles: ["all","svc","assessor","prototype"] image: va/abd_vro-assessclaimdc6510:latest - <<: *common-security-opt - <<: *common-sde-security - <<: *python-healthcheck + <<: [*python-healthcheck, *common-sde-security, *common-security-opt] environment: - <<: *rabbitmq-placeholder-vars - <<: *rabbitmq-client-vars + <<: [*rabbitmq-client-vars, *rabbitmq-placeholder-vars] depends_on: rabbitmq-service: condition: service_healthy @@ -299,12 +274,9 @@ services: svc-assessor-dc6522: profiles: ["all","svc","assessor","prototype"] image: va/abd_vro-assessclaimdc6522:latest - <<: *common-security-opt - <<: *common-sde-security - <<: *python-healthcheck + <<: [*python-healthcheck, *common-sde-security, *common-security-opt] environment: - <<: *rabbitmq-placeholder-vars - <<: *rabbitmq-client-vars + <<: [*rabbitmq-client-vars, *rabbitmq-placeholder-vars] depends_on: rabbitmq-service: condition: service_healthy @@ -314,14 +286,10 @@ services: svc-pdf-generator: profiles: ["all","svc","pdfgen"] image: va/abd_vro-pdfgenerator:latest - <<: *common-security-opt - <<: *common-sde-security - <<: *python-healthcheck + <<: [*python-healthcheck, *common-sde-security, *common-security-opt] environment: MODE: "docker" - <<: *redis-placeholder-vars - <<: *rabbitmq-placeholder-vars - <<: *rabbitmq-client-vars + <<: [*rabbitmq-client-vars, *rabbitmq-placeholder-vars, *redis-placeholder-vars] depends_on: redis-service: condition: service_started @@ -333,12 +301,10 @@ services: svc-lighthouse-api: profiles: ["all","svc","lh"] image: va/abd_vro-service-data-access:latest - <<: *common-security-opt - <<: *common-sde-security + <<: [*common-sde-security, *common-security-opt] environment: # ENV=local causes application-local.properties to be used, in addition to the default application.properties - <<: *common-vars - <<: *rabbitmq-placeholder-vars + <<: [*rabbitmq-placeholder-vars, *common-vars] LH_PRIVATE_KEY: ${LH_PRIVATE_KEY} LH_ACCESS_CLIENT_ID: ${LH_ACCESS_CLIENT_ID} depends_on: @@ -350,11 +316,9 @@ services: svc-bgs-api: profiles: ["all","svc","bgs"] image: va/abd_vro-svc-bgs-api:latest - <<: *common-security-opt - <<: *common-sde-security + <<: [*common-sde-security, *common-security-opt] environment: - <<: *common-vars - <<: *rabbitmq-placeholder-vars + <<: [*rabbitmq-placeholder-vars, *common-vars] # A mock-bgs-api needs to be created and exposes an unused port BGS_BASE_URL: http://mock-bgs-api:9020 depends_on: @@ -366,12 +330,9 @@ services: svc-feature-toggle: profiles: ["all","svc","feature-toggle"] image: va/abd_vro-featuretoggle:latest - <<: *common-security-opt - <<: *common-sde-security + <<: [*common-sde-security, *common-security-opt] environment: - <<: *redis-placeholder-vars - <<: *rabbitmq-placeholder-vars - <<: *rabbitmq-client-vars + <<: [*rabbitmq-client-vars, *rabbitmq-placeholder-vars, *redis-placeholder-vars] depends_on: redis-service: condition: service_started @@ -389,9 +350,7 @@ services: stdin_open: true tty: true environment: - <<: *redis-placeholder-vars - <<: *rabbitmq-placeholder-vars - <<: *postgres-vars + <<: [*postgres-vars, *rabbitmq-placeholder-vars, *redis-placeholder-vars] depends_on: postgres-service: condition: service_healthy @@ -410,8 +369,7 @@ services: mock-bip-ce-api: profiles: ["all","mock","bip","v2-mocks"] image: va/abd_vro-mock-bip-ce-api:latest - <<: *common-security-opt - <<: *common-sde-security + <<: [*common-sde-security, *common-security-opt] hostname: mock-bip-ce-api ports: - "8094:8094" @@ -431,8 +389,7 @@ services: mock-bip-claims-api: profiles: ["all","mock","bip","v2-mocks"] image: va/abd_vro-mock-bip-claims-api:latest - <<: *common-security-opt - <<: *common-sde-security + <<: [*common-sde-security, *common-security-opt] hostname: mock-bip-claims-api ports: - "8097:8097" @@ -452,8 +409,7 @@ services: mock-mas-api: profiles: ["all","mock","mas","v2-mocks"] image: va/abd_vro-mock-mas-api:latest - <<: *common-security-opt - <<: *common-sde-security + <<: [*common-sde-security, *common-security-opt] hostname: mock-mas-api ports: - "9001:9001" @@ -474,8 +430,7 @@ services: mock-lighthouse-api: profiles: ["all","mock","lh","v2-mocks"] image: va/abd_vro-mock-lighthouse-api:latest - <<: *common-security-opt - <<: *common-sde-security + <<: [*common-sde-security, *common-security-opt] hostname: mock-lighthouse-api environment: # ENV=local causes application-local.properties to be used, in addition to the default application.properties @@ -488,8 +443,7 @@ services: mock-slack: profiles: ["all","mock","lh","v2-mocks"] image: va/abd_vro-mock-slack:latest - <<: *common-security-opt - <<: *common-sde-security + <<: [*common-sde-security, *common-security-opt] hostname: mock-slack ports: - "9008:9008" From 710a709486c65d3a26a988742ae5d0ce5d69df68 Mon Sep 17 00:00:00 2001 From: Yoom Lam Date: Tue, 18 Apr 2023 08:28:34 -0500 Subject: [PATCH 2/2] add comment regarding YAML merge --- app/src/docker/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/docker/docker-compose.yml b/app/src/docker/docker-compose.yml index 6c713c1fc4..2479c06251 100644 --- a/app/src/docker/docker-compose.yml +++ b/app/src/docker/docker-compose.yml @@ -10,6 +10,7 @@ volumes: # Reusable blocks # https://medium.com/@kinghuang/docker-compose-anchors-aliases-extensions-a1e4105d70bd +# Also note https://yaml.org/type/merge.html x-common-vars: &common-vars # ENV determines which configuration settings to use.