-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-prod.yml
43 lines (41 loc) · 1.36 KB
/
docker-compose-prod.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
# https://medium.com/@pentacent/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71
version: '3.6'
# mkdir -p /var/lib/postgresql/data && docker volume create --driver local --opt type=none --opt device=/var/lib/postgresql/data --opt o=bind db_data
volumes:
db_data:
external: true
services:
db:
image: postgres:alpine
env_file:
- .env
volumes:
- db_data:/var/lib/postgresql/data
ports:
- "5432:5432"
web:
image: jator/kritikos:release-v0.1.19
ports:
- "8080:8080"
depends_on:
- db
nginx:
image: nginx:1.17-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
depends_on:
- web
volumes:
- ./data/nginx:/etc/nginx/conf.d
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
restart: unless-stopped
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"