esnet-security / SCRAM

Security Catch and Release Automation Manager
Other
5 stars 0 forks source link

Merge common parts of compose configs into a single file, then override as needed #38

Closed grigorescu closed 2 months ago

grigorescu commented 2 months ago

https://docs.docker.com/compose/multiple-compose-files/merge/

grigorescu commented 2 months ago

Did a check of old versus new, and the new ones are functionally equivalent, other than making health checks more consistent and setting a network from null to {}.

$ make toggle-local ; docker compose config > ../new_local_config; make toggle-prod; docker compose config > ../new_prod_config
$ diff ../prod_config ../new_prod_config
11c11
<         condition: service_started
---
>         condition: service_healthy
14c14
<         condition: service_started
---
>         condition: service_healthy
37a38,42
>     healthcheck:
>       test:
>       - CMD
>       - gobgp
>       - global
103a109,112
>     healthcheck:
>       test:
>       - CMD-SHELL
>       - pg_isready -U postgres
122a132,138
>     healthcheck:
>       test:
>       - CMD
>       - redis-cli
>       - --raw
>       - incr
>       - ping
141c157
<         condition: service_started
---
>         condition: service_healthy
144c160
<         condition: service_started
---
>         condition: service_healthy
$ diff ../local_config ../new_local_config
165c165
<       default: null
---
>       default: {}
178c178,181
<         condition: service_started
---
>         condition: service_healthy
>         required: true
>       redis:
>         condition: service_healthy