-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
94 lines (87 loc) · 2.69 KB
/
docker-compose.yaml
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
88
89
90
91
92
93
94
version: "3.4"
services:
# Generates config for containers on the local Docker daemon
nginx_conf_standard:
image: makeshift27015/nginx-conf-generator
environment:
- 'docker_conf={"socketPath": "/var/run/docker.sock"}'
- conf_dir=/conf
- template=/template.vhost
- suffix=standard
volumes:
- ./conf/:/conf
- ./templates/template.vhost:/template.vhost
- /var/run/docker.sock:/var/run/docker.sock
# Generates config for containers on a remote Docker daemon
nginx_conf_media:
image: makeshift27015/nginx-conf-generator
environment:
- destination=media
- 'docker_conf={"host": "media", "port": 2376}'
- conf_dir=/conf
- template=/template.vhost
- suffix=media
volumes:
- ./conf/:/conf
- ./templates/template.vhost:/template.vhost
# Sends SIGHUP to all containers on the local Docker daemon that have the
# "proxy.notify" label when files in `./conf` are modified (`/watch` in the container)
nginx_sighup:
image: makeshift27015/nginx-sighup
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./conf/:/watch
# Does Letsencrypt-y things, just as an example
letsencrypt:
image: adferrand/letsencrypt-dns
environment:
- LETSENCRYPT_USER_MAIL=
- LEXICON_PROVIDER=cloudflare
- LEXICON_CLOUDFLARE_USERNAME=
- LEXICON_CLOUDFLARE_TOKEN=
volumes:
- ./domains.conf:/etc/letsencrypt/domains.conf
- ./letsencrypt/:/etc/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock
# The actual web server, config generated by above containers and mounted to `/etc/nginx/conf.d/`
web:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
networks:
- web
labels:
- proxy.notify
volumes:
- ./conf/:/etc/nginx/conf.d/
- ./letsencrypt:/etc/letsencrypt
- ./dhparam.pem:/etc/nginx/dhparam.pem
depends_on:
- nginx_conf_standard
- nginx_conf_media
- letsencrypt
# An example of a container with basic labels
example:
image: example/example
labels:
- proxy.hosts=example.makeshift.ninja,example.local.makeshift.ninja,example.public.makeshift.ninja
- proxy.port=80
- proxy.isPublic
networks:
- web
# An example of running Portainer with a custom vhost template
portainer:
image: portainer/portainer
networks:
- web
volumes:
- /var/run/docker_conf.sock:/var/run/docker.sock
- ./data:/data
labels:
- proxy.hosts=portainer.makeshift.ninja,portainer.local.makeshift.ninja,portainer.public.makeshift.ninja
- proxy.port=9000
- proxy.template=/templates/portainer.vhost
networks:
web:
external: true