-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtf.yml
More file actions
56 lines (55 loc) · 2.16 KB
/
tf.yml
File metadata and controls
56 lines (55 loc) · 2.16 KB
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
53
54
55
56
version: "3.8"
services:
traefik:
image: traefik:v2.8.5
command:
#- --log.level=DEBUG
#- --accesslog
- --api.dashboard=true
- --providers.docker=true
# run in swarmmode to expose tasks from all nodes
- --providers.docker.swarmmode=true
- --providers.docker.exposedbydefault=false
- --entrypoints.https.address=:443
- --entrypoints.http.address=:80
# letsencrypt certificates
- --certificatesresolvers.le.acme.httpchallenge=true
- --certificatesresolvers.le.acme.httpchallenge.entrypoint=http
- --certificatesresolvers.le.acme.email=${EMAIL?Variable not set}
- --certificatesresolvers.le.acme.storage=/letsencrypt/acme.json
ports:
- 80:80
- 443:443
volumes:
- letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- public
deploy:
placement:
constraints:
# in swarmmode traefik must run on manager
- node.role==manager
labels:
- traefik.enable=true
- traefik.docker.network=public
# - traefik.http.middlewares.admin-auth.basicauth.users=${ADMIN_AUTH?Variable not set}
- traefik.http.middlewares.tf-stripprefix.stripprefix.prefixes=/traefik
# http redirect
- traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
- traefik.http.middlewares.https-redirect.redirectscheme.permanent=true
- traefik.http.routers.traefik.entrypoints=https
- traefik.http.routers.traefik.tls=true
- traefik.http.routers.traefik.tls.certresolver=le
- traefik.http.routers.traefik.rule=PathPrefix(`/traefik`) || PathPrefix(`/api`)
- traefik.http.routers.traefik.middlewares=tf-stripprefix #,admin-auth
- traefik.http.routers.traefik.service=api@internal
- traefik.http.routers.traefik-http.rule=PathPrefix(`/traefik`) || PathPrefix(`/api`)
- traefik.http.routers.traefik-http.entrypoints=http
- traefik.http.routers.traefik-http.middlewares=https-redirect
- traefik.http.services.api.loadbalancer.server.port=8080
networks:
public:
external: true
volumes:
letsencrypt: