-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
executable file
·89 lines (88 loc) · 2.23 KB
/
docker-compose.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
version: '3.8'
services:
api:
build:
context: .
dockerfile: Dockerfile.dev
depends_on:
db:
condition: service_healthy
db-migration:
condition: service_completed_successfully
ports:
- '3000:3000'
tty: true
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
environment:
UV_THREADPOOL_SIZE: 128
NODE_ENV: production
LOG_LEVEL: info
PORT: 3000
PG_CONNECTION: postgres://todo-user:password123!@db:5432/dev-todo
REDIS_HOST: 'redis'
REDIS_PORT: 6379
command: ['npm', 'run', 'start:server:dev']
worker:
build:
context: .
dockerfile: Dockerfile.dev
depends_on:
db:
condition: service_healthy
db-migration:
condition: service_completed_successfully
tty: true
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
environment:
UV_THREADPOOL_SIZE: 128
NODE_ENV: production
LOG_LEVEL: info
PG_CONNECTION: postgres://todo-user:password123!@db:5432/dev-todo
REDIS_HOST: 'redis'
REDIS_PORT: 6379
command: ['npm', 'run', 'start:worker:dev']
db-migration:
build:
context: .
dockerfile: Dockerfile.dev
command: ['node', './db/run-migration.js', '/usr/src/app/db/patches']
environment:
UV_THREADPOOL_SIZE: 128
NODE_ENV: production
LOG_LEVEL: info
PG_CONNECTION: postgres://todo-user:password123!@db:5432/dev-todo
PG_MIGRATION_CONNECTION: postgres://root-user:password123!@db:5432/postgres
tty: true
depends_on:
db:
condition: service_healthy
volumes:
- .:/usr/src/app
db:
image: postgres:alpine
environment:
POSTGRES_DB: postgres
POSTGRES_USER: root-user
POSTGRES_PASSWORD: password123!
PGPASSWORD: password123!
healthcheck:
test: ['CMD', '/health-check.sh', 'postgres', 'root-user', 'password123!']
interval: 15s
timeout: 10s
retries: 20
ports:
- '15432:5432'
tty: true
volumes:
- ./db/health-check.sh:/health-check.sh
- ./db/postgresql.conf:/etc/postgresql.conf
tmpfs:
- /var/lib/postgresql/data
redis:
image: redis:alpine
ports:
- '16379:6379'