mirror of
https://github.com/JamesTurland/JimsGarage.git
synced 2024-11-22 07:50:19 +00:00
0a03c29c22
Add to config a .home and wildcard cert with *.home. to seperate the the internal exposed services and the external in a easy way.
50 lines
2.7 KiB
YAML
50 lines
2.7 KiB
YAML
version: '3'
|
|
|
|
services:
|
|
traefik:
|
|
image: traefik:latest
|
|
container_name: traefik
|
|
restart: unless-stopped
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
networks:
|
|
proxy:
|
|
ports:
|
|
- 80:80
|
|
- 81:81 # external http
|
|
- 443:443
|
|
- 444:444 # external https
|
|
environment:
|
|
- CF_API_EMAIL=your@email.com
|
|
- CF_DNS_API_TOKEN=super-secure-token
|
|
# - CF_API_KEY=YOU_API_KEY
|
|
# be sure to use the correct one depending on if you are using a token or key
|
|
volumes:
|
|
- /etc/localtime:/etc/localtime:ro
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
- /home/ubuntu/docker/traefik/traefik.yml:/traefik.yml:ro
|
|
- /home/ubuntu/docker/traefik/acme.json:/acme.json
|
|
- /home/ubuntu/docker/traefik/config.yml:/config.yml:ro
|
|
- /home/ubuntu/docker/traefik/logs:/var/log/traefik
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.traefik.entrypoints=http" # restricts dashboard to internal entrypoint
|
|
- "traefik.http.routers.traefik.rule=Host(`traefik-dashboard.yourdomain.co.uk`)" # if you want a internal domain, get the wildcard cert for it and then choos traefik-dashboard.home.yourdomain.co.uk or what you want
|
|
- "traefik.http.middlewares.traefik-auth.basicauth.users=admin:password-hash"
|
|
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
|
|
- "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https"
|
|
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
|
|
- "traefik.http.routers.traefik-secure.entrypoints=https"
|
|
- "traefik.http.routers.traefik-secure.rule=Host(`traefik-dashboard.yourdomain.co.uk`)" # if you want a internal domain, get the wildcard cert for it and then choos traefik-dashboard.home.yourdomain.co.uk or what you want
|
|
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
|
|
- "traefik.http.routers.traefik-secure.tls=true"
|
|
- "traefik.http.routers.traefik-secure.tls.certresolver=cloudflare"
|
|
#- "traefik.http.routers.traefik-secure.tls.domains[0].main=home.yourdomain.co.uk" # If you want *.home.yourdomain.co.uk subdomain or something else, you have to get the certifcates at first
|
|
#- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.home.yourdomain.co.uk" # get a wildcard certificat for your .home.yourdomain.co.uk
|
|
- "traefik.http.routers.traefik-secure.tls.domains[0].main=yourdomain.co.uk" #if you use the .home.yourdomain.co.uk entry you have to change the [0] into [1]
|
|
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.yourdomain.co.uk" # same here, change 0 to 1
|
|
- "traefik.http.routers.traefik-secure.service=api@internal"
|
|
|
|
networks:
|
|
proxy:
|
|
external: true
|