Last active
March 11, 2018 00:01
-
-
Save snewell92/f9b3787d4322314cfd613fc07a59b7bf to your computer and use it in GitHub Desktop.
basic http traefik
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: "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 |
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
# 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 |
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
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" |
Latest revision adds https, mostly from reading https://docs.traefik.io/user-guide/examples/#ondemand-option-with-http-challenge
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Will add a revision for https