Last active
August 26, 2021 03:14
-
-
Save leesei/aaa22b2ea191c2ef313096622359c7e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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