-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathdocker-compose-https.yml
More file actions
67 lines (61 loc) · 1.82 KB
/
docker-compose-https.yml
File metadata and controls
67 lines (61 loc) · 1.82 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
57
58
59
60
61
62
63
64
65
66
67
version: '2'
services:
syncthing:
image: istepanov/syncthing
restart: always
ports:
- "22000:22000"
- "21027:21027/udp"
volumes:
- config:/home/syncthing/.config/syncthing
- data:/home/syncthing/Sync
environment:
VIRTUAL_HOST: ${SYNCTHING_HOSTNAME} # e.g. "syncthing.myserver.net"
VIRTUAL_PORT: '8384'
LETSENCRYPT_HOST: ${SYNCTHING_HOSTNAME}
LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL} # e.g. "myname@myemail.host". Required by Let's Encrypt.
# Nginx proxy. Just official image, all configs are auto-generated (see below)
nginx:
image: nginx
container_name: nginx
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- /etc/nginx/conf.d
- /etc/nginx/vhost.d
- /usr/share/nginx/html
- certs:/etc/nginx/certs:ro
# Nginx config generator. It looks for containers with VIRTUAL_HOST env var and automatically generates Nginx config files
nginx-gen:
image: jwilder/docker-gen
container_name: nginx-gen
restart: always
volumes_from:
- nginx
volumes:
- nginx-templates:/etc/docker-gen/templates:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
command: -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
# Automatic creation/renewal LetEncrypt SSL certs
nginx-letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: nginx-letsencrypt
restart: always
environment:
NGINX_DOCKER_GEN_CONTAINER: nginx-gen
volumes_from:
- nginx
volumes:
- certs:/etc/nginx/certs:rw
- /var/run/docker.sock:/var/run/docker.sock:ro
volumes:
config:
driver: local
data:
driver: local
certs:
external: true
nginx-templates:
external: true