-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
64 lines (61 loc) · 1.45 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
version: "3.9"
services:
app:
image: papko26/gtw:latest
container_name: gtw
ports:
- "5000:5000"
env_file:
- gtw.env
environment:
- GOOGLE_API_KEY=${GOOGLE_API_KEY}
- FLASK_ENV=${FLASK_ENV}
- FLASK_DEBUG=${FLASK_DEBUG}
restart: always
nginx:
image: nginx:latest
container_name: nginx
depends_on:
- app
ports:
- "80:80"
- "443:443"
volumes:
- type: bind
source: /etc/nginx/nginx.conf
target: /etc/nginx/nginx.conf
read_only: true
- type: bind
source: /etc/nginx/certs
target: /etc/letsencrypt
read_only: true
- type: bind
source: /var/www/certbot
target: /var/www/certbot
restart: always
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- type: bind
source: /etc/nginx/certs
target: /etc/letsencrypt
- type: bind
source: /etc/nginx/certs-data
target: /var/lib/letsencrypt
- type: bind
source: /var/www/certbot
target: /var/www/certbot
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
entrypoint: >
/bin/sh -c '
trap exit TERM;
while :; do
sleep 12h & wait $${!};
certbot renew \
--webroot -w /var/www/certbot \
--deploy-hook "docker kill -s HUP nginx";
done'
restart: unless-stopped