-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
79 lines (74 loc) · 1.98 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
# Reverse proxy, the actual, exposed endpoint
nginx:
image: nginx
container_name: nginx
ports:
- "80:80"
- "443:443"
volumes:
- /etc/nginx/certs:/etc/nginx/certs:ro
- /etc/nginx/conf.d
- /etc/nginx/vhost.d
- /usr/share/nginx/html
restart: always
# Automated generation of the proxy's config
nginx-gen:
image: jwilder/docker-gen
container_name: nginx-gen
volumes_from:
- nginx
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro
command:
-notify-sighup nginx -watch -only-exposed -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
restart: always
# Automated renewal of https certs
letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt
environment:
- NGINX_DOCKER_GEN_CONTAINER=nginx-gen
volumes_from:
- nginx
volumes:
- /etc/nginx/certs:/etc/nginx/certs:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: always
# Sample web server, replace env vars!!!
web:
image: nginx
container_name: web
environment:
- VIRTUAL_HOST=purpletentacle.rocks
- LETSENCRYPT_HOST=purpletentacle.rocks
volumes:
- ./public:/usr/share/nginx/html:ro
restart: always
# cdn
cdn:
image: nginx
container_name: cdn
environment:
- VIRTUAL_HOST=cdn.purpletentacle.rocks
- LETSENCRYPT_HOST=cdn.purpletentacle.rocks
volumes:
- ../cdn:/usr/share/nginx/html:ro
restart: always
# Registry
registry:
image: registry:2
container_name: registry
env_file: ../registry.env
environment:
- VIRTUAL_HOST=registry.purpletentacle.rocks
- VIRTUAL_PORT=5000
- LETSENCRYPT_HOST=registry.purpletentacle.rocks
volumes:
- ../registry/public:/var/lib/registry
# - /etc/nginx/certs:/certs
- ../registry/auth:/auth
restart: always