updated traefik boilerplates

This commit is contained in:
Christian Lempa 2024-11-08 11:06:02 +01:00
parent 21a92824ea
commit c6427658df
4 changed files with 49 additions and 87 deletions

View File

@ -6,21 +6,19 @@ services:
ports: ports:
- 80:80 - 80:80
- 443:443 - 443:443
# -- (Optional) Enable Dashboard, don't do in production # --> (Optional) Enable Dashboard, don't do in production
# - 8080:8080 # - 8080:8080
# <--
volumes: volumes:
- /run/docker.sock:/run/docker.sock:ro - /run/docker.sock:/run/docker.sock:ro
- ./config/traefik.yaml:/etc/traefik/traefik.yaml:ro - ./config/traefik.yaml:/etc/traefik/traefik.yaml:ro
- ./config/conf.d/:/etc/traefik/conf.d/:ro
- ./data/certs/:/var/traefik/certs/:rw - ./data/certs/:/var/traefik/certs/:rw
# -- (Optional) When using Cloudflare as Cert Resolver - ./config/conf.d/:/etc/traefik/conf.d/:ro
# environment: environment:
# - CF_DNS_API_TOKEN=your-cloudflare-api-token - CF_DNS_API_TOKEN=your-cloudflare-api-token # <-- Change this to your Cloudflare API Token
# -- (Optional) When using a custom network networks:
# networks: - frontend
# - your-traefik-network
restart: unless-stopped restart: unless-stopped
# -- (Optional) When using a custom network networks:
# networks: frontend:
# your-traefik-network: external: true # <-- (Optional) Change this to false if you want to create a new network
# external: true

View File

@ -1,16 +0,0 @@
http:
routers:
your-local-router:
rule: "Host(`your-local-service.your-domain.com`) && PathPrefix(`/`)"
service: your-local-service
priority: 1000
entryPoints:
- web
# (optional) Permanent Redirect to HTTPS
# - websecure
services:
your-local-service:
loadBalancer:
servers:
- url: "http://your-local-service:port"

View File

@ -0,0 +1,16 @@
http:
# -- Change Router Configuration here...
routers:
your-local-router:
rule: "Host(`your-local-service.your-domain.com`)" # <-- Change Rules here...
service: your-local-service # <-- Change Service Name here...
priority: 1000 # <-- (Optional) Change Routing Priority here...
entryPoints:
- web, websecure
# -- Change Service Configuration here...
services:
your-local-service: # <-- Change Service Name here...
loadBalancer:
servers:
- url: "http://your-local-service:port" # <-- Change Target Service URL here...

View File

@ -2,93 +2,57 @@ global:
checkNewVersion: false checkNewVersion: false
sendAnonymousUsage: false sendAnonymousUsage: false
# -- (Optional) Change log level and format here ... # --> (Optional) Change log level and format here ...
# - level: [TRACE, DEBUG, INFO, WARN, ERROR, FATAL] # - level: [TRACE, DEBUG, INFO, WARN, ERROR, FATAL]
# - format: [common, json]
# log: # log:
# level: ERROR # level: ERROR
# format: common # <--
# filePath: /var/log/traefik/traefik.log
# -- (Optional) Enable accesslog and change format here ... # --> (Optional) Enable accesslog here ...
# - format: [common, json] # accesslog: {}
# accesslog: # <--
# format: common
# filePath: /var/log/traefik/access.log
# -- (Optional) Enable API and Dashboard here, don't do in production # --> (Optional) Enable API and Dashboard here, don't do in production
# api: # api:
# dashboard: true # dashboard: true
# disableDashboardAd: true
# insecure: true # insecure: true
# <--
# -- Change EntryPoints here... # -- Change EntryPoints here...
entryPoints: entryPoints:
web: web:
address: :80 address: :80
# -- (Optional) Redirect all HTTP to HTTPS # --> (Optional) Redirect all HTTP to HTTPS
# http: # http:
# redirections: # redirections:
# entryPoint: # entryPoint:
# to: websecure # to: websecure
# scheme: https # scheme: https
# <--
websecure: websecure:
address: :443 address: :443
# -- (Optional) Add custom Entrypoint
# custom:
# address: :8081
# -- Configure your CertificateResolver here... # -- Configure your CertificateResolver here...
# certificatesResolvers: certificatesResolvers:
# cloudflare-staging: cloudflare:
# acme: acme:
# email: your-email@example.com email: your-email@example.com # <-- Change this to your email
# storage: /var/traefik/certs/cloudflare-acme.json storage: /var/traefik/certs/cloudflare-acme.json
# caServer: "https://acme-staging-v02.api.letsencrypt.org/directory" caServer: "https://acme-v02.api.letsencrypt.org/directory"
# -- (Optional) Remove this section, when using DNS Challenge dnsChallenge:
# httpChallenge: provider: cloudflare # <-- (Optional) Change this to your DNS provider
# entryPoint: web resolvers:
# -- (Optional) Configure DNS Challenge - "1.1.1.1:53"
# dnsChallenge: - "8.8.8.8:53"
# provider: your-resolver (e.g. cloudflare)
# resolvers:
# - "1.1.1.1:53"
# - "8.8.8.8:53"
# cloudflare:
# acme:
# email: your-email@example.com
# storage: /var/traefik/certs/cloudflare-acme.json
# caServer: "https://acme-v02.api.letsencrypt.org/directory"
# -- (Optional) Remove this section, when using DNS Challenge
# httpChallenge:
# entryPoint: web
# -- (Optional) Configure DNS Challenge
# dnsChallenge:
# provider: your-resolver (e.g. cloudflare)
# resolvers:
# - "1.1.1.1:53"
# - "8.8.8.8:53"
# -- (Optional) Disable TLS Cert verification check # --> (Optional) Disable TLS Cert verification check
# serversTransport: # serversTransport:
# insecureSkipVerify: true # insecureSkipVerify: true
# <--
# -- (Optional) Overwrite Default Certificates
# tls:
# stores:
# default:
# defaultCertificate:
# certFile: /etc/traefik/certs/cert.pem
# keyFile: /etc/traefik/certs/cert-key.pem
# -- (Optional) Disable TLS version 1.0 and 1.1
# options:
# default:
# minVersion: VersionTLS12
providers: providers:
docker: docker:
# -- (Optional) Enable this, if you want to expose all containers automatically exposedByDefault: false # <-- (Optional) Change this to true if you want to expose all services
exposedByDefault: false
file: file:
directory: /etc/traefik directory: /etc/traefik
watch: true watch: true