bunkerized-nginx/examples/mongo-express/swarm.yml

52 lines
1.4 KiB
YAML

version: "3"
services:
mongo:
image: mongo:5.0.14
networks:
- bw-services
volumes:
- db-data:/data/db
environment:
- MONGO_INITDB_ROOT_USERNAME=root # replace with a less obvious username
- MONGO_INITDB_ROOT_PASSWORD=toor # replace with a better password
- MONGO_INITDB_DATABASE=mongo # replace with the database name of your choice
deploy:
placement:
constraints:
- "node.role==worker"
mongo-ui:
image: mongo-express:0.54.0
networks:
- bw-services
environment:
- ME_CONFIG_MONGODB_SERVER=mongo
- ME_CONFIG_MONGODB_ADMINUSERNAME=root # replace with a less obvious username
- ME_CONFIG_MONGODB_ADMINPASSWORD=toor # replace with a better password
- ME_CONFIG_BASICAUTH_USERNAME=changeme # replace with a better username
- ME_CONFIG_BASICAUTH_PASSWORD=changeme # replace with a better password
depends_on:
- mongo
deploy:
restart_policy:
condition: on-failure
delay: 3s
max_attempts: 10
placement:
constraints:
- "node.role==worker"
labels:
- bunkerweb.SERVER_NAME=www.example.com
- bunkerweb.USE_REVERSE_PROXY=yes
- bunkerweb.REVERSE_PROXY_URL=/
- bunkerweb.REVERSE_PROXY_HOST=http://mongo-ui:8081
networks:
bw-services:
external: true
name: bw-services
volumes:
db-data: