-
Notifications
You must be signed in to change notification settings - Fork 22
/
docker-compose.prod.yml
62 lines (55 loc) · 1.31 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
53
54
55
56
57
58
59
60
61
62
version: "3.9"
services:
db:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: "${DB_ROOT_PASSWORD}"
MYSQL_DATABASE: "${DB_NAME}"
MYSQL_USER: "${DB_USERNAME}"
MYSQL_PASSWORD: "${DB_PASSWORD}"
restart: always
healthcheck:
test: "mysql -uroot -p$DB_ROOT_PASSWORD -e 'select 1;'"
interval: 1s
retries: 20
volumes:
- database_invoide_prod:/var/lib/mysql
networks:
- invoice_prod
server:
restart: always
environment:
# It's important to specify this in order for the external packages
# to act accordingly(e.g. the `debug` package won't print as it does in DEV mode).
NODE_ENV: production
DB_HOST: 'db'
build:
context: ./server/
dockerfile: .docker/Dockerfile.prod
args:
GIT_COMMIT: git log -1 --format=%h
command: npm run prod
volumes:
- $PWD/server:/app
- /app/node_modules
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "127.0.0.1:3000:3000"
networks:
- invoice_prod
redis:
image: redis:6.2
networks:
- invoice_prod
healthcheck:
test: "redis-cli ping"
interval: 1s
retries: 20
volumes:
database_invoide_prod:
networks:
invoice_prod: