Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make default production docker-compose assume a single-node cluster #172

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions infrastructure/docker-compose.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ services:
# Configure webapps and add traefik config
client:
environment:
- DECLARED_DECLARATION_SEARCH_QUERY_COUNT=100
- COUNTRY_CONFIG_URL=https://countryconfig.{{hostname}}
- CONTENT_SECURITY_POLICY_WILDCARD=${CONTENT_SECURITY_POLICY_WILDCARD}
- MINIO_URL=https://minio.{{hostname}}
Expand Down Expand Up @@ -578,6 +579,11 @@ services:
- 'traefik.http.routers.block-dashboard-queries.middlewares=block-internal-routes'
replicas: 1
environment:
- NODE_ENV=production
- FHIR_URL=http://hearth:3447/fhir
- AUTH_URL=http://auth:4040
- APPLICATION_CONFIG_URL=http://config:2021
- CONFIRM_REGISTRATION_URL=http://workflow:5050/confirm/registration
- MONGO_URL=mongodb://mongo1/user-mgnt?replicaSet=rs0
- CONFIG_MONGO_URL=mongodb://mongo1/application-config?replicaSet=rs0
- APN_SERVICE_URL=http://apm-server:8200
Expand Down Expand Up @@ -639,6 +645,8 @@ services:
- jwt-public-key.{{ts}}
- jwt-private-key.{{ts}}
environment:
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN:-}
- APN_SERVICE_URL=http://apm-server:8200
- CERT_PRIVATE_KEY_PATH=/run/secrets/jwt-private-key.{{ts}}
- CERT_PUBLIC_KEY_PATH=/run/secrets/jwt-public-key.{{ts}}
Expand Down Expand Up @@ -673,6 +681,8 @@ services:
secrets:
- jwt-public-key.{{ts}}
environment:
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN:-}
- APN_SERVICE_URL=http://apm-server:8200
- RECORD_SEARCH_QUOTA=2000
- CERT_PUBLIC_KEY_PATH=/run/secrets/jwt-public-key.{{ts}}
Expand All @@ -692,6 +702,9 @@ services:
secrets:
- jwt-public-key.{{ts}}
environment:
- NODE_ENV=production
- LANGUAGES=en,fr
- SENTRY_DSN=${SENTRY_DSN:-}
- APN_SERVICE_URL=http://apm-server:8200
- CERT_PUBLIC_KEY_PATH=/run/secrets/jwt-public-key.{{ts}}
- MONGO_URL=mongodb://notification:${NOTIFICATION_MONGODB_PASSWORD}@mongo1/notification?replicaSet=rs0
Expand All @@ -710,6 +723,9 @@ services:
secrets:
- jwt-public-key.{{ts}}
environment:
- NODE_ENV=production
- LANGUAGES=en,fr
- SENTRY_DSN=${SENTRY_DSN:-}
- APN_SERVICE_URL=http://apm-server:8200
- CERT_PUBLIC_KEY_PATH=/run/secrets/jwt-public-key.{{ts}}
- LOGIN_URL=https://login.{{hostname}}
Expand Down Expand Up @@ -743,6 +759,9 @@ services:
secrets:
- jwt-public-key.{{ts}}
environment:
- NODE_ENV=production
- LANGUAGES=en,fr
- SENTRY_DSN=${SENTRY_DSN:-}
- APN_SERVICE_URL=http://apm-server:8200
- CERT_PUBLIC_KEY_PATH=/run/secrets/jwt-public-key.{{ts}}
deploy:
Expand All @@ -760,6 +779,8 @@ services:
secrets:
- jwt-public-key.{{ts}}
environment:
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN:-}
- ES_HOST=search-user:${ROTATING_SEARCH_ELASTIC_PASSWORD}@elasticsearch:9200
- APN_SERVICE_URL=http://apm-server:8200
- CERT_PUBLIC_KEY_PATH=/run/secrets/jwt-public-key.{{ts}}
Expand All @@ -781,6 +802,8 @@ services:
volumes:
- /data/vsexport:/usr/src/app/packages/metrics/src/scripts
environment:
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN:-}
- APN_SERVICE_URL=http://apm-server:8200
- CERT_PUBLIC_KEY_PATH=/run/secrets/jwt-public-key.{{ts}}
- MONGO_URL=mongodb://metrics:${METRICS_MONGODB_PASSWORD}@mongo1/metrics?replicaSet=rs0
Expand All @@ -802,6 +825,7 @@ services:
tag: 'metrics'
scheduler:
environment:
- NODE_ENV=production
- OPENHIM_MONGO_URL=mongodb://openhim:${OPENHIM_MONGODB_PASSWORD}@mongo1/openhim-dev?replicaSet=rs0
deploy:
replicas: 1
Expand All @@ -822,6 +846,7 @@ services:
secrets:
- jwt-public-key.{{ts}}
environment:
- NODE_ENV=production
- APN_SERVICE_URL=http://apm-server:8200
- CERT_PUBLIC_KEY_PATH=/run/secrets/jwt-public-key.{{ts}}
- MINIO_ACCESS_KEY=${MINIO_ROOT_USER}
Expand All @@ -841,6 +866,8 @@ services:
secrets:
- jwt-public-key.{{ts}}
environment:
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN:-}
- APN_SERVICE_URL=http://apm-server:8200
- CERT_PUBLIC_KEY_PATH=/run/secrets/jwt-public-key.{{ts}}
- MONGO_URL=mongodb://config:${CONFIG_MONGODB_PASSWORD}@mongo1/application-config?replicaSet=rs0
Expand Down Expand Up @@ -925,6 +952,8 @@ services:
secrets:
- jwt-public-key.{{ts}}
environment:
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN:-}
- APN_SERVICE_URL=http://apm-server:8200
- MONGO_URL=mongodb://webhooks:${WEBHOOKS_MONGODB_PASSWORD}@mongo1/webhooks?replicaSet=rs0
- CERT_PUBLIC_KEY_PATH=/run/secrets/jwt-public-key.{{ts}}
Expand Down
157 changes: 0 additions & 157 deletions infrastructure/docker-compose.production-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,97 +9,13 @@ version: '3.3'
#

services:
gateway:
environment:
- NODE_ENV=production
- LANGUAGES=en,fr
- SENTRY_DSN=${SENTRY_DSN:-}
deploy:
replicas: 2

workflow:
environment:
- NODE_ENV=production
- LANGUAGES=en,fr
- SENTRY_DSN=${SENTRY_DSN:-}
deploy:
replicas: 2

search:
environment:
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN:-}
deploy:
replicas: 2

metrics:
environment:
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN:-}
- MONGO_URL=mongodb://metrics:${METRICS_MONGODB_PASSWORD}@mongo1,mongo2/metrics?replicaSet=rs0
- HEARTH_MONGO_URL=mongodb://hearth:${HEARTH_MONGODB_PASSWORD}@mongo1,mongo2/hearth-dev?replicaSet=rs0
- DASHBOARD_MONGO_URL=mongodb://performance:${PERFORMANCE_MONGODB_PASSWORD}@mongo1,mongo2/performance?replicaSet=rs0

auth:
environment:
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN:-}
deploy:
replicas: 2

user-mgnt:
environment:
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN:-}
- MONGO_URL=mongodb://user-mgnt:${USER_MGNT_MONGODB_PASSWORD}@mongo1,mongo2/user-mgnt?replicaSet=rs0
deploy:
replicas: 2

notification:
environment:
- NODE_ENV=production
- LANGUAGES=en,fr
- SENTRY_DSN=${SENTRY_DSN:-}
- MONGO_URL=mongodb://notification:${NOTIFICATION_MONGODB_PASSWORD}@mongo1,mongo2/notification?replicaSet=rs0
deploy:
replicas: 2

webhooks:
environment:
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN:-}
- MONGO_URL=mongodb://webhooks:${WEBHOOKS_MONGODB_PASSWORD}@mongo1,mongo2/webhooks?replicaSet=rs0
deploy:
replicas: 2

config:
environment:
- NODE_ENV=production
- SENTRY_DSN=${SENTRY_DSN:-}
- MONGO_URL=mongodb://config:${CONFIG_MONGODB_PASSWORD}@mongo1,mongo2/application-config?replicaSet=rs0
deploy:
replicas: 2

scheduler:
environment:
- NODE_ENV=production
- OPENHIM_MONGO_URL=mongodb://openhim:${OPENHIM_MONGODB_PASSWORD}@mongo1,mongo2/openhim-dev?replicaSet=rs0

documents:
environment:
- NODE_ENV=production

countryconfig:
image: ${DOCKERHUB_ACCOUNT}/${DOCKERHUB_REPO}:${COUNTRY_CONFIG_VERSION}
restart: unless-stopped
secrets:
- jwt-public-key.{{ts}}
environment:
- NODE_ENV=production
- FHIR_URL=http://hearth:3447/fhir
- AUTH_URL=http://auth:4040
- APPLICATION_CONFIG_URL=http://config:2021
- CONFIRM_REGISTRATION_URL=http://workflow:5050/confirm/registration
- CHECK_INVALID_TOKEN=true
- SENTRY_DSN=${SENTRY_DSN:-}
- SENDER_EMAIL_ADDRESS=${SENDER_EMAIL_ADDRESS}
Expand All @@ -109,79 +25,6 @@ services:
- SMTP_USERNAME=${SMTP_USERNAME}
- SMTP_PASSWORD=${SMTP_PASSWORD}
- SMTP_SECURE=${SMTP_SECURE}
deploy:
replicas: 2

client:
environment:
- DECLARED_DECLARATION_SEARCH_QUERY_COUNT=100
deploy:
replicas: 2

logstash:
deploy:
replicas: 2

apm-server:
deploy:
replicas: 2

components:
deploy:
replicas: 2

login:
deploy:
replicas: 2

hearth:
environment:
- mongodb__url=mongodb://hearth:${HEARTH_MONGODB_PASSWORD}@mongo1,mongo2/hearth-dev?replicaSet=rs0

deploy:
replicas: 2

migration:
environment:
- USER_MGNT_MONGO_URL=mongodb://user-mgnt:${USER_MGNT_MONGODB_PASSWORD}@mongo1,mongo2/user-mgnt?replicaSet=rs0
- APPLICATION_CONFIG_MONGO_URL=mongodb://config:${CONFIG_MONGODB_PASSWORD}@mongo1,mongo2/application-config?replicaSet=rs0
- PERFORMANCE_MONGO_URL=mongodb://performance:${PERFORMANCE_MONGODB_PASSWORD}@mongo1,mongo2/performance?replicaSet=rs0
- HEARTH_MONGO_URL=mongodb://hearth:${HEARTH_MONGODB_PASSWORD}@mongo1,mongo2/hearth-dev?replicaSet=rs0
- OPENHIM_MONGO_URL=mongodb://openhim:${OPENHIM_MONGODB_PASSWORD}@mongo1,mongo2/openhim-dev?replicaSet=rs0
- WAIT_HOSTS=mongo1:27017,mongo2:27017,influxdb:8086,minio:9000,elasticsearch:9200

mongo2:
image: mongo:4.4
hostname: 'mongo2'
restart: unless-stopped
command: mongod --auth --replSet rs0 --keyFile /etc/mongodb-keyfile
volumes:
- '/data/mongo:/data/db'
- '/mongodb-keyfile:/mongodb-keyfile'
entrypoint:
- bash
- -c
- |
cp /mongodb-keyfile /etc/mongodb-keyfile
chmod 400 /etc/mongodb-keyfile
chown 999:999 /etc/mongodb-keyfile
exec docker-entrypoint.sh $$@
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGODB_ADMIN_USER}
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_ADMIN_PASSWORD}
deploy:
labels:
- 'traefik.enable=false'
replicas: 1
placement:
constraints:
- node.labels.data2 == true
networks:
- overlay_net

mongo-on-update:
environment:
- REPLICAS=2

traefik:
# These templates use an Automatic Certificate Management Environment (Let's Encrypt).
Expand Down
Loading