From 9ef0dc76a848d5c7cf74a34a61ea43522105f532 Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 22 Nov 2023 02:07:42 +0000 Subject: [PATCH] Add stack.yml --- stack.yml | 133 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 stack.yml diff --git a/stack.yml b/stack.yml new file mode 100644 index 0000000..2b2f2c2 --- /dev/null +++ b/stack.yml @@ -0,0 +1,133 @@ +version: '3.7' +services: + swarmpit: + image: swarmpit/swarmpit:latest + environment: + - SWARMPIT_DB=http://swarmpit_couchdb:5984 + - SWARMPIT_INFLUXDB=http://swarmpit_influxdb:8086 + - SWAMPIT_DOCKER_SOCK=http://socketproxy_socketproxy:2375 + 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: + - net + - traefik + - socketproxy + deploy: + placement: + constraints: + - node.hostname == macmini14 + labels: + - "us.nixc.autodeploy=true" + - "traefik.enable=true" + - "traefik.http.routers.swarmpit_swarmpit.tls=true" + - "traefik.http.services.swarmpit_swarmpit.loadbalancer.server.port=8080" + - "traefik.http.routers.swarmpit_swarmpit.rule=Host(`swarmpit.nixc.us`)" + - "traefik.http.routers.swarmpit_swarmpit.entrypoints=websecure" + - "traefik.http.routers.swarmpit_swarmpit.tls.certresolver=letsencryptresolver" + - "traefik.http.routers.swarmpit_swarmpit.service=swarmpit_swarmpit@docker" + - "traefik.docker.network=traefik" + resources: + limits: + cpus: '0.50' + memory: 1024M + reservations: + cpus: '0.25' + memory: 512M + placement: + constraints: + - node.role == manager + logging: + driver: "gelf" + options: + gelf-address: "udp://log.nixc.us:15124" + tag: "swarmpit_swarmpit" + + couchdb: + image: couchdb:2.3.0 + volumes: + - /mnt/tank/persist/nixc.us/swarmpit/production/couchdb:/opt/couchdb/data + networks: + - net + deploy: + resources: + limits: + cpus: '0.30' + memory: 256M + reservations: + cpus: '0.15' + memory: 128M + placement: + constraints: + - node.hostname == macmini14 + labels: + - "us.nixc.autodeploy=true" + logging: + driver: "gelf" + options: + gelf-address: "udp://log.nixc.us:15124" + tag: "swarmpit_couchdb" + influxdb: + image: influxdb:1.7 + volumes: + - /mnt/tank/persist/nixc.us/swarmpit/production/influxdb:/var/lib/influxdb + networks: + - net + deploy: + resources: + limits: + cpus: '0.60' + memory: 512M + reservations: + cpus: '0.30' + memory: 128M + placement: + constraints: + - node.hostname == macmini14 + labels: + - "us.nixc.autodeploy=true" + logging: + driver: "gelf" + options: + gelf-address: "udp://log.nixc.us:15124" + tag: "swarmpit_influxdb" + + agent: + image: swarmpit/agent:latest + environment: + - DOCKER_API_VERSION=1.43 + - EVENT_ENDPOINT=http://swarmpit_swarmpit:8080/events + - HEALTH_CHECK_ENDPOINT=http://swarmpit_swarmpit:8080/version + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + networks: + - net + deploy: + mode: global + labels: + us.nixc.autodeploy: 'true' + swarmpit.agent: 'true' + resources: + limits: + cpus: '0.10' + memory: 64M + reservations: + cpus: '0.05' + memory: 32M + logging: + driver: "gelf" + options: + gelf-address: "udp://log.nixc.us:15124" + tag: "swarmpit_agent" + +networks: + net: + driver: overlay + traefik: + external: true + socketproxy: + external: true \ No newline at end of file