Skip to content

Instantly share code, notes, and snippets.

@leesei
Last active August 26, 2021 03:14
Show Gist options
  • Save leesei/aaa22b2ea191c2ef313096622359c7e9 to your computer and use it in GitHub Desktop.
Save leesei/aaa22b2ea191c2ef313096622359c7e9 to your computer and use it in GitHub Desktop.
version: "3.3"
services:
caddy:
deploy:
# this cannot control the number of replicas
replicas: 0
mongo:
ports:
- 127.0.0.1:27017:27017
deploy:
# this can control the number of replicas
replicas: 2
version: "3.3"
services:
caddy:
image: caddy:2-alpine
hostname: "{{.Service.Name}}.{{.Task.Slot}}"
ports:
- 80:80
- 443:443
- 8080:8080
# entrypoint: ["sh", "-c", "while true; do echo sleep; sleep 1; done"]
deploy:
replicas: 2
restart_policy:
condition: on-failure
mongo:
image: mongo:4.4-bionic
hostname: "{{.Service.Name}}.{{.Task.Slot}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment