Last active
July 18, 2017 13:49
-
-
Save bnason/aa1965d7891a9301c2f6f17dd2f48008 to your computer and use it in GitHub Desktop.
Swarn - Traefik + Docker Socket Proxy
This file contains 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.1" | |
services: | |
proxy: | |
image: traefik:1.3-alpine | |
networks: | |
shared: | |
private: | |
ports: | |
- "80:80" | |
- "443:443" | |
- "8080:8080" | |
depends_on: | |
- dockersocket | |
deploy: | |
mode: global | |
placement: | |
constraints: | |
- node.role == worker | |
tty: true | |
command: | |
# Use your favourite settings here, but add: | |
- --web | |
- --Docker | |
- --Docker.EndPoint=http://dockersocket:2375 | |
- --Docker.ExposedByDefault=false | |
- --Docker.SwarmMode | |
- --Docker.Watch | |
- --loglevel=DEBUG | |
dockersocket: | |
image: tecnativa/docker-socket-proxy | |
networks: | |
private: | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
environment: | |
CONTAINERS: 1 | |
NETWORKS: 1 | |
SERVICES: 1 | |
SWARM: 1 | |
TASKS: 1 | |
deploy: | |
mode: global | |
placement: | |
constraints: | |
- node.role == manager | |
networks: | |
shared: | |
driver_opts: | |
encrypted: 1 | |
private: | |
driver_opts: | |
encrypted: 1 |
This file contains 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.1' | |
services: | |
whoami: | |
image: emilevauge/whoami | |
networks: | |
- traefik | |
deploy: | |
labels: | |
- "traefik.enable=true" | |
- "traefik.port=80" | |
- "traefik.backend=whoami" | |
- "traefik.frontend.rule=Host:whoami.brandonnason.com" | |
networks: | |
traefik: | |
external: | |
name: traefik_shared |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment