-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
56 lines (55 loc) · 2.18 KB
/
docker-compose.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
53
54
55
56
version: '3'
services:
reverse-proxy:
image: traefik:latest
command:
- --api.insecure=true
- --providers.docker
# setup dynamic config directory as /config volume
- --providers.file.directory=/config
- --providers.file.watch=true
# setup http entrypoint on port 80
- --entrypoints.web.address=:80
# setup https entrypoint on port 9443
- --entrypoints.websecure.address=:443
- --entrypoints.traefik.address=:8080
- --log.filePath=/logs/traefik.log
- --log.level=debug
- --log.format=json
- --accesslog=true
- --accesslog.filepath=/logs/access.log
- --accesslog.format=json
labels:
# catchall http -> https redirect
- traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)
- traefik.http.routers.http-catchall.entrypoints=web
- traefik.http.routers.http-catchall.middlewares=redirect-to-https@docker
- traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https
- traefik.http.middlewares.redirect-to-https.redirectscheme.port=9443
ports:
- "8080:8080"
# http port
- "9080:80"
# https port - backends to 443
- "9443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
# config volume from this repo as readonly
- ./config:/config:ro
# adding volume containing ssl certs
- ./certs:/certs:ro
# adding volume for log files
- ./logs:/logs
whoami:
image: containous/whoami
container_name: whoami.docker.local
labels:
- traefik.enable=true
# removing all the http router/middlewares since we will never see them.
#- traefik.http.routers.whoami-http.entrypoints=web
#- traefik.http.routers.whoami-http.rule=Host(`whoami.docker.local`) && PathPrefix(`/whoami`)
#- traefik.http.middlewares.whoami-http.stripprefix.prefixes=/whoami
- traefik.http.routers.whoami-https.entrypoints=websecure
- traefik.http.routers.whoami-https.tls=true
- traefik.http.routers.whoami-https.rule=Host(`whoami.docker.local`) && PathPrefix(`/whoami`)
- traefik.http.middlewares.whoami-https.stripprefix.prefixes=/whoami