-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-prod.yml
52 lines (48 loc) · 1.51 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
44
45
46
47
48
49
50
51
52
version: '3.6'
services:
backend-prod:
restart: unless-stopped
build:
context: ./backend
dockerfile: Dockerfile-prod
volumes:
- './backend:/usr/src/app'
- '/usr/src/app/node_modules'
environment:
- NODE_ENV=production
depends_on:
- mysql
mysql:
image: mysql:5.7
environment:
MYSQL_DATABASE: "${DATABASE_NAME}"
MYSQL_USER: "${DATABASE_USER}"
MYSQL_PASSWORD: "${DATABASE_PASSWORD}"
MYSQL_ROOT_PASSWORD: "${DATABASE_PASSWORD}"
volumes:
- './database:/var/lib/mysql'
ports:
- 3307:3306
frontend-prod:
restart: unless-stopped
build:
context: ./frontend
dockerfile: Dockerfile-prod
environment:
- NODE_ENV=production
depends_on:
- backend-prod
ports:
- "80:80"
- "443:443"
volumes:
- ./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;'"