docker-swarm-visualizer/docker-compose.yml

127 lines
2.8 KiB
YAML

version: "3.8"
services:
visualizer:
image: dockersamples/visualizer:latest
ports:
- "8001:8080"
stop_grace_period: 1m30s
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
deploy:
update_config:
failure_action: rollback
placement:
constraints:
- 'node.role == manager'
networks:
- diyue-network
swarmpit-app:
image: swarmpit/swarmpit:latest
ports:
- "888:8080"
environment:
- SWARMPIT_DB=http://swarmpit-db:5984
- SWARMPIT_INFLUXDB=http://swarmpit-influxdb:8086
- TZ=Asia/Shanghai
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080"]
interval: 60s
timeout: 10s
retries: 3
networks:
- diyue-network
deploy:
resources:
limits:
cpus: '0.50'
memory: 1024M
reservations:
cpus: '0.05'
memory: 200M
placement:
constraints:
- node.role == manager
swarmpit-db:
image: couchdb:2.3.1
hostname: swarmpit-db
volumes:
- db-data:/opt/couchdb/data
networks:
- diyue-network
deploy:
resources:
limits:
cpus: '0.30'
memory: 512M
reservations:
cpus: '0.10'
memory: 256M
placement:
constraints:
- node.labels.swarmpit.db-data == true
swarmpit-influxdb:
image: influxdb:1.8
hostname: swarmpit-influxdb
volumes:
- influx-data:/var/lib/influxdb
networks:
- diyue-network
deploy:
resources:
reservations:
cpus: '0.1'
memory: 128M
limits:
cpus: '0.6'
memory: 512M
placement:
constraints:
- node.labels.swarmpit.influx-data == true
swarmpit-agent:
image: swarmpit/agent:latest
environment:
- DOCKER_API_VERSION=1.43
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- diyue-network
deploy:
mode: global
labels:
swarmpit.agent: 'true'
resources:
limits:
cpus: '0.10'
memory: 64M
reservations:
cpus: '0.05'
memory: 32M
volumes:
db-data:
driver: local
influx-data:
driver: local
networks:
diyue-network:
driver: overlay
attachable: true
# portainer:
# image: portainer/portainer:latest
# ports:
# - "8002:9000"
# volumes:
# - "/var/run/docker.sock:/var/run/docker.sock"
# deploy:
# update_config:
# failure_action: rollback
# placement:
# constraints:
# - 'node.role == manager'