-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-production.yml
38 lines (38 loc) · 1.05 KB
/
docker-compose-production.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
version: '3'
services:
front:
build:
context: ./frontend
dockerfile: production/Dockerfile
volumes:
- ./frontend/production/nginx:/etc/nginx/conf.d
- ./frontend/production/certbot/conf:/etc/letsencrypt
- ./frontend/production/certbot/www:/var/www/certbot
ports:
- "80:80"
- "443:443"
restart: unless-stopped
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
api:
build:
context: ./api
args:
RAILS_ENV: production
environment:
- SECRET_KEY_BASE
- POSTGRES_PASSWORD
depends_on:
- db
db:
image: postgres
environment:
- POSTGRES_PASSWORD
volumes:
- ./db:/var/lib/postgresql/data
certbot:
image: certbot/certbot
volumes:
- ./frontend/production/certbot/conf:/etc/letsencrypt
- ./frontend/production/certbot/www:/var/www/certbot
restart: unless-stopped
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"