-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
34 lines (31 loc) · 1.01 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
# based on https://pentacent.medium.com/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71
version: '3'
services:
# proxy nginx
nginx:
container_name: reverse_proxy
# do not touch this
image: nginx:alpine
command: [nginx-debug, '-g', 'daemon off;']
ports:
- 80:80
- 443:443
volumes:
- /var/www/reverse_proxy/conf.d:/etc/nginx/conf.d
- /var/www/reverse_proxy/certbot/conf:/etc/letsencrypt
- /var/www/reverse_proxy/certbot/www:/var/www/certbot
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
restart: always
networks:
- front
certbot:
image: certbot/certbot
volumes:
- /var/www/reverse_proxy/certbot/conf:/etc/letsencrypt
- /var/www/reverse_proxy/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
networks:
- front
networks:
front:
name: front