version: "3.8" networks: iklimco-net: external: true volumes: postgresql_data: mongodb_data: services: postgresql: image: {{ db_postgres_image }} environment: POSTGRES_USER: "{{ db_postgres_root_user }}" POSTGRES_PASSWORD: "{{ db_postgres_password }}" POSTGRES_DB: postgres PGDATA: /var/lib/postgresql/data/pgdata volumes: - postgresql_data:/var/lib/postgresql/data networks: - iklimco-net deploy: placement: constraints: - node.labels.role == db mongodb: image: {{ db_mongo_image }} environment: MONGO_INITDB_ROOT_USERNAME: "{{ db_mongo_root_user }}" MONGO_INITDB_ROOT_PASSWORD: "{{ db_mongo_root_password }}" volumes: - mongodb_data:/data/db - /opt/iklimco/db/mongodb/config/mongod.conf:/etc/mongod.conf command: ["--config", "/etc/mongod.conf"] networks: - iklimco-net deploy: placement: constraints: - node.labels.role == db