perfect traefik.yml config
This commit is contained in:
parent
609ae67567
commit
5d40b40a39
@ -1,21 +1,29 @@
|
|||||||
version: "3.9"
|
version: "3.9"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
reverse-proxy:
|
traefik-reverse-proxy:
|
||||||
image: traefik:v2.5
|
image: traefik:v2.5
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
- "443:443"
|
- "443:443"
|
||||||
environment:
|
environment:
|
||||||
- "TZ=Asia/Shanghai"
|
- "TZ=Asia/Shanghai"
|
||||||
|
- LINODE_TOKEN=${LINODE_TOKEN}
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.traefik-dashboard.rule=Host(`traefik.esin.io`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
|
||||||
|
- "traefik.http.routers.traefik-dashboard.tls=true"
|
||||||
|
- "traefik.http.routers.traefik-dashboard.service=api@internal"
|
||||||
|
- "traefik.http.routers.traefik-dashboard.middlewares=traefik-dashboard-auth"
|
||||||
|
- "traefik.http.middlewares.traefik-dashboard-auth.basicauth.users=${AUTH_USER}:${AUTH_PASS}"
|
||||||
|
- "traefik.http.middlewares.traefik-dashboard.compress=true"
|
||||||
|
- "traefik.http.middlewares.traefik-dashboard.compress.excludedcontenttypes=text/event-stream"
|
||||||
volumes:
|
volumes:
|
||||||
|
- ./traefik/acme.json:/etc/acme/acme.json
|
||||||
|
- ./traefik/log:/var/log/traefik
|
||||||
|
- ./traefik/config/dynamic.d:/etc/traefik/dynamic.d:ro
|
||||||
|
- ./traefik/config/static.yml:/etc/traefik/traefik.yml:ro
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
- ./conf:/etc/traefik/config
|
|
||||||
- ./acme.json:/etc/acme/acme.json
|
|
||||||
- ./log:/var/log
|
|
||||||
- ./traefik.yml:/etc/traefik/traefik.yml:ro
|
|
||||||
networks:
|
networks:
|
||||||
- traefik
|
- traefik
|
||||||
|
|
||||||
|
@ -1,14 +1,32 @@
|
|||||||
|
global:
|
||||||
|
sendanonymoususage: false
|
||||||
|
checknewversion: false
|
||||||
|
|
||||||
entryPoints:
|
entryPoints:
|
||||||
web:
|
web:
|
||||||
address: ":80"
|
address: ":80"
|
||||||
|
http:
|
||||||
|
redirections:
|
||||||
|
entryPoint:
|
||||||
|
to: websecure
|
||||||
|
scheme: https
|
||||||
websecure:
|
websecure:
|
||||||
address: ":443"
|
address: ":443"
|
||||||
|
http:
|
||||||
|
tls:
|
||||||
|
certresolver: letsencrypt
|
||||||
|
domains:
|
||||||
|
- main: "esin.io"
|
||||||
|
sans: "*.esin.io"
|
||||||
|
|
||||||
providers:
|
providers:
|
||||||
docker:
|
docker:
|
||||||
|
watch: true
|
||||||
|
network: traefik
|
||||||
exposedByDefault: false
|
exposedByDefault: false
|
||||||
file:
|
file:
|
||||||
directory: "/etc/traefik/config"
|
watch: true
|
||||||
|
directory: "/etc/traefik/dynamic.d"
|
||||||
|
|
||||||
api:
|
api:
|
||||||
dashboard: true
|
dashboard: true
|
||||||
@ -20,15 +38,19 @@ certificatesResolvers:
|
|||||||
acme:
|
acme:
|
||||||
email: "hi@esin.io"
|
email: "hi@esin.io"
|
||||||
storage: "/etc/acme/acme.json"
|
storage: "/etc/acme/acme.json"
|
||||||
|
tlsChallenge: {}
|
||||||
httpChallenge:
|
httpChallenge:
|
||||||
entryPoint: web
|
entryPoint: web
|
||||||
|
dnschallenge:
|
||||||
|
provider: linode
|
||||||
|
delayBeforeCheck: 0
|
||||||
|
|
||||||
log:
|
log:
|
||||||
filePath: "/var/log/traefik.log"
|
filePath: "/var/log/traefik/traefik.log"
|
||||||
format: json
|
format: json
|
||||||
level: INFO
|
level: INFO
|
||||||
|
|
||||||
accessLog:
|
accessLog:
|
||||||
filePath: "/var/log/access.log"
|
filePath: "/var/log/traefik/access.log"
|
||||||
format: json
|
format: json
|
||||||
bufferingSize: 100
|
bufferingSize: 100
|
||||||
|
Loading…
x
Reference in New Issue
Block a user