Refactor swarm/core.yml to update gantry service and cronjob deployment

This commit is contained in:
2024-06-06 22:13:59 +08:00
parent c76c18289a
commit dc5c78c507
+24 -18
View File
@@ -123,30 +123,36 @@ services:
# Use the public network created to be shared between Traefik and # Use the public network created to be shared between Traefik and
# any other service that needs to be publicly available with HTTPS # any other service that needs to be publicly available with HTTPS
- traefik-public - traefik-public
shepherd:
image: containrrr/shepherd gantry:
image: shizunge/gantry
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment: environment:
# Beware YAML gotchas regarding quoting: - "GANTRY_NODE_NAME={{.Node.Hostname}}"
# With KEY: 'VALUE', quotes are part of yaml syntax and thus get stripped # The gantry service is able to find the name of itself service. Use GANTRY_SERVICES_SELF when you want to set a different value.
# but with KEY='VALUE', they are part of the value and stay there, # - "GANTRY_SERVICES_SELF=${STACK}_gantry"
# causing problems! - "GANTRY_SLEEP_SECONDS=0"
TZ: 'Asia/Singapore' deploy:
SLEEP_TIME: '240m' replicas: 0
FILTER_SERVICES: '' placement:
VERBOSE: 'true' constraints:
UPDATE_OPTIONS: '--update-delay=60s' - node.role==manager
ROLLBACK_OPTIONS: '--rollback-delay=0s' restart_policy:
IMAGE_AUTOCLEAN_LIMIT: '1' condition: none
RUN_ONCE_AND_EXIT: 'false' labels:
- swarm.cronjob.enable=true
- swarm.cronjob.schedule=45 23 0 * * *
- swarm.cronjob.skip-running=true
cronjob:
image: crazymax/swarm-cronjob:latest
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
deploy: deploy:
replicas: 1
restart_policy:
condition: any
placement: placement:
constraints: constraints:
- node.role == manager - node.role==manager
volumes: volumes:
# Create a volume to store the certificates, there is a constraint to make sure # Create a volume to store the certificates, there is a constraint to make sure