-
Notifications
You must be signed in to change notification settings - Fork 6
/
traefik.yml
52 lines (50 loc) · 1.86 KB
/
traefik.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
version: "3.8"
# https://docs.docker.com/compose/compose-file/compose-file-v3/
services:
traefik:
# https://doc.traefik.io/traefik/
image: traefik:latest
# https://hub.docker.com/_/traefik
command:
# https://doc.traefik.io/traefik/reference/static-configuration/cli/
# Enable dashboard and api access https://doc.traefik.io/traefik/operations/dashboard/
- "--api.insecure=true"
# Enable docker backend https://doc.traefik.io/traefik/providers/docker/
- "--providers.docker=true"
# Use docker swarm
- "--providers.docker.swarmmode=true"
# Don't expose containers to the internet
- "--providers.docker.exposedbydefault=false"
# Overlay network used to connect containers to traefik
- "--providers.docker.network=traefik"
# HTTP entrypoint
- "--entrypoints.web.address=:80"
# Redirect HTTP to HTTPS
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
# HTTPS entrypoint
- "--entrypoints.websecure.address=:443"
# Enable TLS for HTTPS by default
- "--entrypoints.websecure.http.tls=true"
# Default certificate resolver
- "--entrypoints.websecure.http.tls.certresolver=letsencrypt"
# Use HTTP-01 challenge to get TLS certs
- "--certificatesResolvers.letsencrypt.acme.httpchallenge.entryPoint=web"
# Email used to register cert
- "--certificatesResolvers.letsencrypt.acme.email=email@yourdomain.test"
# Where to save certs
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
ports:
- 80:80
- 443:443
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik:/letsencrypt
networks:
- traefik
networks:
traefik:
external: true
volumes:
traefik: