Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.24 KB | None | 0 0
  1. to start it:
  2.  
  3. docker run -v '/home/$USER/traefik:/etc/traefik' \
  4.     -v '/var/run/docker.sock:/var/run/docker.sock:ro' \
  5.     -p "80:80" -p "443:443" -p "8080:8080" --restart always \
  6.     -e "DO_AUTH_TOKEN=$DO_AUTH_TOKEN" \
  7.     --name traefik -d $@ traefik
  8.  
  9.  
  10. # rules.toml
  11.  
  12. [http.middlewares]
  13.   [http.middlewares.changehost.headers]
  14.     [http.middlewares.changehost.headers.customRequestHeaders]
  15.        Host = "hass.example.com"
  16.  
  17. [backends]
  18.   [backends.backend-hass]
  19.     [backends.backend-hass.servers]
  20.       [backends.backend-hass.servers.server-hass-ext]
  21.         url = "http://backend-server-ip:8123"
  22.         weight = 0
  23.  
  24. [frontends]
  25.   [frontends.frontend-hass]
  26.     backend = "backend-hass"
  27.  
  28.     passHostHeader = true
  29.     [frontends.frontend-hass.routes]
  30.        [frontends.frontend-hass.routes.route-hass-ext]
  31.           rule = "Host:hass.example.com"
  32.   [frontends.frontend-hass-public]
  33.     backend = "backend-hass"
  34.     passHosHeader = false
  35.     middlewares = ["changehost"]
  36.  
  37. #traefik.toml
  38.  
  39. debug = false
  40. logLevel = "ERROR"
  41. InsecureSkipVerify = true
  42. defaultEntryPoints = ["https", "http"]
  43.  
  44. # WEB interface of Traefik - it will show web page with overview of frontend and backend configurations
  45. [api]
  46.   entryPoint = "traefik"
  47.   dashboard = true
  48.   address = ":8080"
  49.  
  50. # Force HTTPS
  51. [entryPoints]
  52.   [entryPoints.http]
  53.     address = ":80"
  54.     [entryPoints.http.redirect]
  55.     entryPoint = "https"
  56.     [entryPoints.web.forwardedHeaders]
  57.       trustedIPs = ["10.0.0.1/32", "172.17.0.2/32"]
  58.   [entryPoints.https]
  59.     address = ":443"
  60.     [entryPoints.https.tls]
  61.  
  62. [file]
  63.   watch = true
  64.   filename = "/etc/traefik/rules.toml"
  65.  
  66. # Let's encrypt configuration
  67. [acme]
  68. email = "user@example.com" #any email id will work
  69. storage="/etc/traefik/acme/acme.json"
  70. entryPoint = "https"
  71. acmeLogging=true
  72. onDemand = false #create certificate when container is created
  73. [acme.dnsChallenge]
  74.   provider = "digitalocean"
  75.   delayBeforeCheck = 0
  76.   [[acme.domains]]
  77.     main = "hass.example.com"
  78.  
  79. # Connection to docker host system (docker.sock)
  80. [docker]
  81. endpoint = "unix:///var/run/docker.sock"
  82. domain = "hass.example.com"
  83. watch = true
  84. # This will hide all docker containers that don't have explicitly
  85. # set label to "enable"
  86. exposedbydefault = false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement