Skip to content

Instantly share code, notes, and snippets.

@neilbartley
Last active October 24, 2018 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neilbartley/8959a2bae5ca2bea87951ce2c3dae691 to your computer and use it in GitHub Desktop.
Save neilbartley/8959a2bae5ca2bea87951ce2c3dae691 to your computer and use it in GitHub Desktop.
Calming App Jams with Træfik
version: '3.4'
services:
traefik:
# Use the apline image, its lovely and small - 22MB!
image: traefik:1.7.3-alpine
# This just exposes the ports to the host, the host firewall is configured separately
ports:
- "443:443" # Expose HTTPS port (and available externally)
- "80:80" # Expose HTTP port (and available externally)
- "8080:8080" # Expose port for the træfik UI (not available externally)
# This is the network which traefik uses to communicate with other containers
networks:
- traefik
# I've commented these out to make it simpler to get running and placed a volume mount on line 25 instead.
#configs:
# - source: traefik_v1.1.toml
# target: /traefik.toml
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Required to talk to Docker
- /home/dev/reverse-proxy/traefik.toml:/traefik.toml # This is a volume mount for the træfik configuration (see line 18)
- /home/dev/reverse-proxy/acme.json:/acme.json # This is used to store information generated by LetsEncrypt. There is
# no config for this, just touch a blank file before starting the stack.
deploy:
placement:
constraints:
- node.role == manager # Only run this on a swarm manager
# See comment on line 18, above
#configs:
# traefik_v1.1.toml:
# external: true
# Overlay network definition other apps will use this to talk to this service
networks:
traefik:
driver: overlay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment