diff --git a/infrastructure/deployment/deploy.sh b/infrastructure/deployment/deploy.sh index 9926277c..0ab917c4 100755 --- a/infrastructure/deployment/deploy.sh +++ b/infrastructure/deployment/deploy.sh @@ -263,6 +263,7 @@ export PERFORMANCE_MONGODB_PASSWORD=`generate_password` export OPENHIM_MONGODB_PASSWORD=`generate_password` export WEBHOOKS_MONGODB_PASSWORD=`generate_password` export NOTIFICATION_MONGODB_PASSWORD=`generate_password` +export EVENTS_MONGODB_PASSWORD=`generate_password` # # Elasticsearch credentials diff --git a/infrastructure/deployment/download-images.sh b/infrastructure/deployment/download-images.sh index 38d23332..3eda1c58 100755 --- a/infrastructure/deployment/download-images.sh +++ b/infrastructure/deployment/download-images.sh @@ -341,6 +341,7 @@ export PERFORMANCE_MONGODB_PASSWORD=`generate_password` export OPENHIM_MONGODB_PASSWORD=`generate_password` export WEBHOOKS_MONGODB_PASSWORD=`generate_password` export NOTIFICATION_MONGODB_PASSWORD=`generate_password` +export EVENTS_MONGODB_PASSWORD=`generate_password` # # Elasticsearch credentials diff --git a/infrastructure/docker-compose.app.yml b/infrastructure/docker-compose.app.yml index 1623e594..7bdbf1e4 100644 --- a/infrastructure/docker-compose.app.yml +++ b/infrastructure/docker-compose.app.yml @@ -217,6 +217,7 @@ services: - HOST=0.0.0.0 - NODE_ENV=production - LANGUAGES=en,fr + - EVENTS_URL=http://events:5555/ - SENTRY_DSN=${SENTRY_DSN:-} - DISABLE_RATE_LIMIT=true - REDIS_HOST=redis.${STACK}_app_net @@ -270,6 +271,11 @@ services: aliases: [] dependencies_minio_net: aliases: [] + events: + image: opencrvs/ocrvs-events:${VERSION} + restart: unless-stopped + environment: + - MONGO_URL=mongodb://${STACK}__events:${METRICS_MONGODB_PASSWORD}@mongo1/${STACK}__events?replicaSet=rs0 workflow: image: opencrvs/ocrvs-workflow:${VERSION} diff --git a/infrastructure/mongodb/on-deploy.sh b/infrastructure/mongodb/on-deploy.sh index b1b6f80e..ae1040d4 100755 --- a/infrastructure/mongodb/on-deploy.sh +++ b/infrastructure/mongodb/on-deploy.sh @@ -167,6 +167,28 @@ else EOF fi +EVENTS_USER=$(echo $(checkIfUserExists "${DATABASE_PREFIX}__events" "${DATABASE_PREFIX}__events")) +if [[ $EVENTS_USER != "FOUND" ]]; then + echo "events user not found" + mongo $(mongo_credentials) --host $HOST <