Skip to content

Instantly share code, notes, and snippets.

@containeroo-gists
Last active February 12, 2022 19:24
Show Gist options
  • Save containeroo-gists/866810758db56ea33a9c59390c18ea81 to your computer and use it in GitHub Desktop.
Save containeroo-gists/866810758db56ea33a9c59390c18ea81 to your computer and use it in GitHub Desktop.
api:
dashboard: true
debug: true
entryPoints:
http:
address: ":80"
https:
address: ":443"
providers:
docker:
endpoint: "unix:///var/run/docker.sock"
exposedByDefault: false
file:
filename: /config.yml
certificatesResolvers:
http:
acme:
email: email@example.com
storage: acme.json
httpChallenge:
entryPoint: http
@Dr0nen
Copy link

Dr0nen commented Oct 20, 2020

according to https://medium.com/@containeroo/traefik-2-2-docker-global-entrypoint-configuration-ff11d7f84913, should traefik.yml be revised as follows:

api:
  dashboard: true
  debug: true

entryPoints:
  http:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: https
  https:
    address: ":443"
    http:
      middlewares:
        - default-headers@file
      tls:
        certResolver: cloudflare
        domains:
          - main: example.com
            sans:
              - "*.example.com"

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false
  file:
    filename: /config.yml

certificatesResolvers:
  http:
    acme:
      email: email@email.com
      storage: acme.json
      httpChallenge:
        entryPoint: http

@rxbn
Copy link

rxbn commented Oct 20, 2020

according to https://medium.com/@containeroo/traefik-2-2-docker-global-entrypoint-configuration-ff11d7f84913, should traefik.yml be revised as follows:

api:
  dashboard: true
  debug: true

entryPoints:
  http:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: https
  https:
    address: ":443"
    http:
      middlewares:
        - default-headers@file
      tls:
        certResolver: cloudflare
        domains:
          - main: example.com
            sans:
              - "*.example.com"

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false
  file:
    filename: /config.yml

certificatesResolvers:
  http:
    acme:
      email: email@email.com
      storage: acme.json
      httpChallenge:
        entryPoint: http

Thanks a lot! This gist ist for our advanced Traefik guide. I have created a new one with your example and I will link it in the medium article mentioned by you. Thanks again :)

https://gist.github.com/containeroo-gists/8f924b5c976330e76b07b4abcad9ebd4

@Dr0nen
Copy link

Dr0nen commented Oct 20, 2020

Thank You Robin. My contribution pales by comparison to yours.

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