Skip to content

Instantly share code, notes, and snippets.

@sjpuas
Last active September 28, 2017 23:06
Show Gist options
  • Save sjpuas/0686cf5cc0fc2f65db2366eeea2affea to your computer and use it in GitHub Desktop.
Save sjpuas/0686cf5cc0fc2f65db2366eeea2affea to your computer and use it in GitHub Desktop.
Example Docker Stack
version: '3.2'
services:
proxy:
image: containous/traefik:latest
command: --web --docker --docker.swarmmode --docker.watch --logLevel=DEBUG
ports:
- 80:80
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /dev/null:/etc/traefik/traefik.toml
labels:
- "traefik.enable=false"
deploy:
placement:
constraints:
- node.role == manager
replicas: 1
resources:
limits:
memory: 256M
networks:
- backend
greeting-service:
image: bennu/greeting-microservice:1.0.0
deploy:
replicas: 1
resources:
limits:
memory: 15M
update_config:
parallelism: 1
delay: 10s
failure_action: rollback
labels:
- "traefik.port=8000"
- "traefik.backend=greeting-service"
- "traefik.frontend.rule=PathPrefixStrip:/v1/greeting"
networks:
- backend
networks:
backend:
driver: overlay
attachable: true
ipam:
driver: default
config:
- subnet: 10.20.0.0/16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment