bunkerweb/examples/mongo-express/swarm.yml
Jordan Blasenhauer 86cb619b5f add bunkerweb 1.6
2024-07-01 11:21:54 +02:00

49 lines
1.4 KiB
YAML

services:
mongo:
image: mongo:7
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:1-20-alpine3.19
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: