-
Notifications
You must be signed in to change notification settings - Fork 3
/
compose.dev.yml
62 lines (58 loc) · 1.53 KB
/
compose.dev.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
services:
server:
image: node:18-alpine
command: sh -c "npm install && npm run build; npm run db:migrate:data; npm run db:setup -- -f -d && npm run db:seed:dev && npm run serve:dev:nodocker"
working_dir: /usr/src/app
ports:
- 3420:3420 # server
- 9227:9227 # debug
volumes:
# use local files as source
- .:/usr/src/app
environment:
NODE_ENV: development
# contains db connection info that matches db service setup below
CONFIG_FILE: config-dev.json
# waits for db and redis to start
depends_on:
db_accounts:
condition: service_healthy
db_data:
condition: service_healthy
redis:
condition: service_healthy
# colorizes output
tty: true
db_accounts:
image: postgres:14-alpine
# matches config in config-dev.json
environment:
POSTGRES_DB: dev_accounts
POSTGRES_USER: dev
POSTGRES_PASSWORD: dev
healthcheck:
test: ['CMD-SHELL', 'pg_isready -d dev_accounts -U dev']
interval: 1s
timeout: 3s
retries: 5
db_data:
image: postgres:14-alpine
# matches config in config-dev.json
environment:
POSTGRES_DB: dev_data
POSTGRES_USER: dev
POSTGRES_PASSWORD: dev
healthcheck:
test: ['CMD-SHELL', 'pg_isready -d dev_data -U dev']
interval: 1s
timeout: 3s
retries: 5
redis:
image: redis:7-alpine
healthcheck:
test: ['CMD-SHELL', 'redis-cli ping']
interval: 1s
timeout: 3s
retries: 5
volumes:
node_modules: