Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
124 lines (118 loc) · 2.74 KB
/
Copy pathdocker-compose.yml
File metadata and controls
124 lines (118 loc) · 2.74 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: fynt
POSTGRES_PASSWORD: fynt
POSTGRES_DB: fynt
ports:
- "${FYNT_POSTGRES_PORT:-55432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U fynt -d fynt"]
interval: 5s
timeout: 3s
retries: 20
restart: unless-stopped
redis:
image: redis:7-alpine
command: ["redis-server", "--appendonly", "yes"]
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 20
restart: unless-stopped
bootstrap:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env.docker
environment:
NODE_ENV: production
command:
- /bin/sh
- -lc
- (pnpm exec prisma --config prisma.config.ts migrate deploy || pnpm exec prisma --config prisma.config.ts db push) && pnpm db:seed
depends_on:
postgres:
condition: service_healthy
restart: "no"
realtime:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env.docker
environment:
NODE_ENV: production
command: ["pnpm", "--filter", "@fynt/realtime", "start"]
depends_on:
bootstrap:
condition: service_completed_successfully
redis:
condition: service_healthy
ports:
- "3101:3101"
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://127.0.0.1:3101/health').then((res)=>process.exit(res.ok?0:1)).catch(()=>process.exit(1))",
]
interval: 10s
timeout: 5s
retries: 10
restart: unless-stopped
worker:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env.docker
environment:
NODE_ENV: production
command: ["pnpm", "--filter", "@fynt/worker", "start"]
depends_on:
bootstrap:
condition: service_completed_successfully
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
web:
build:
context: .
dockerfile: Dockerfile
env_file:
- .env.docker
environment:
NODE_ENV: production
command:
- /bin/sh
- -lc
- pnpm --filter @fynt/web build && pnpm --filter @fynt/web start
depends_on:
bootstrap:
condition: service_completed_successfully
postgres:
condition: service_healthy
redis:
condition: service_healthy
realtime:
condition: service_healthy
ports:
- "3000:3000"
restart: unless-stopped
volumes:
postgres_data:
redis_data: