Skip to content

Instantly share code, notes, and snippets.

@snewell92
Last active March 11, 2018 00:01
Show Gist options
  • Save snewell92/f9b3787d4322314cfd613fc07a59b7bf to your computer and use it in GitHub Desktop.
Save snewell92/f9b3787d4322314cfd613fc07a59b7bf to your computer and use it in GitHub Desktop.
basic http traefik
version: "2"
services:
app:
image: crccheck/hello-world
restart: always
networks:
- web
- default
expose:
- "8000"
labels:
- "traefik.backend=testweb"
- "traefik.docker.network=web"
- "traefik.frontend.rule=Host:test.host"
- "traefik.enable=true"
- "traefik.port=8000"
networks:
web:
external: true
# run `docker network create web` first!
version: '2'
services:
traefik:
image: traefik
restart: always
ports:
- 80:80
- 443:443
networks:
- web # run `docker network create web` first!
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/traefik.toml
- ./acme.json:/acme.json
container_name: traefik
# run `docker network create web` first!
networks:
web:
external: true
debug = false
logLevel = "ERROR"
defaultEntryPoints = ["https", "http"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[retry]
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "localhost"
watch = true
exposedbydefault = false
[acme]
email = "[email protected]"
storage = "acme.json"
entryPoint = "https"
OnDemand = true # THIS WILL RUN THE FIRST ITME A REQUEST FOR THIS DOMAIN IS RUN
[acme.httpChallenge]
entryPoint = "http"
@snewell92
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment