-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
87 lines (78 loc) · 2.87 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
version: '2'
services:
static:
image: nginx:alpine
volumes:
- ./conf:/conf
- ./conf/default.conf:/etc/nginx/conf.d/default.conf
- ./static:/static
- "${DEVENV_WEB_PATH}:/var/www"
labels:
- "traefik.enable=true"
- "traefik.http.routers.static-devenv-http.rule=HostRegexp(`{subdomain:[a-z0-9]+}.dev.env`) || Host(`dev.env`)"
- "traefik.http.routers.static-devenv-http.priority=5"
- "traefik.http.routers.static-devenv-http.tls=false"
- "traefik.http.routers.static-devenv-https.rule=HostRegexp(`{subdomain:[a-z0-9]+}.dev.env`) || Host(`dev.env`)"
- "traefik.http.routers.static-devenv-https.priority=5"
- "traefik.http.routers.static-devenv-https.tls=true"
restart: always
networks:
- devenv
traefik:
image: traefik
command:
#- "--log.level=DEBUG"
- "--api=true"
- "--entryPoints.web.address=:80"
- "--entryPoints.websecure.address=:443"
- "--providers.docker=true"
- "--providers.docker.constraints=LabelRegex(`devenv.subdomains`,`.+`) || Label(`traefik.enable`,`true`)"
- "--providers.docker.defaultRule=Host(`{{ replace \",\" \".dev.env`,`\" (or (index .Labels \"devenv.subdomains\") .Name) }}.dev.env`)"
- "--providers.docker.network=devenv"
- "--providers.file.filename=/conf/dynamic.toml"
- "--providers.file.watch=true"
- "--serversTransport.forwardingTimeouts.dialTimeout=240s"
ports:
- "80:80"
- "443:443"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./conf:/conf
labels:
- "devenv.subdomains=traefik"
- "traefik.http.routers.traefik-devenv-http.service=api@internal"
- "traefik.http.routers.traefik-devenv-http.tls=false"
- "traefik.http.routers.traefik-devenv-http.middlewares=api-http"
- "traefik.http.routers.traefik-devenv-https.service=api@internal"
- "traefik.http.routers.traefik-devenv-https.tls=true"
- "traefik.http.routers.traefik-devenv-https.middlewares=api-https"
- "traefik.http.middlewares.api-http.headers.customresponseheaders.Access-Control-Allow-Origin=http://dev.env"
- "traefik.http.middlewares.api-https.headers.customresponseheaders.Access-Control-Allow-Origin=https://dev.env"
restart: always
networks:
- devenv
dnsmasq:
image: dnsmasq
build: dnsmasq/
ports:
- "127.0.0.1:53:53/udp"
volumes:
- ./dnsmasq/dnsmasq.conf:/etc/dnsmasq.conf
cap_add:
- NET_ADMIN
restart: always
networks:
- devenv
# whoami:
# image: containous/whoami
# labels:
# - "devenv.subdomains=whoami"
# - "traefik.http.routers.whoami-devenv-http.tls=false"
# - "traefik.http.routers.whoami-devenv-https.tls=true"
# restart: always
# networks:
# - devenv
networks:
devenv:
external: true