-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
120 lines (115 loc) · 2.73 KB
/
Copy pathdocker-compose.yml
File metadata and controls
120 lines (115 loc) · 2.73 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
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- '5432:5432'
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
interval: 10s
timeout: 5s
retries: 10
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
restart: unless-stopped
ports:
- '6379:6379'
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 5s
retries: 10
volumes:
- redis_data:/data
api:
build:
context: .
dockerfile: infra/docker/api.Dockerfile
env_file:
- .env
environment:
CHOKIDAR_USEPOLLING: 'true'
TSC_WATCHFILE: UsePolling
TSC_WATCHDIRECTORY: UsePolling
command: sh infra/scripts/start-api.sh
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
ports:
- '3001:3001'
restart: unless-stopped
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://127.0.0.1:3001/health').then((response) => process.exit(response.ok ? 0 : 1)).catch(() => process.exit(1))",
]
interval: 15s
timeout: 5s
retries: 10
start_period: 240s
volumes:
- .:/workspace
- workspace_node_modules:/workspace/node_modules
- pnpm_store:/pnpm/store
- storage_data:/workspace/storage
web:
build:
context: .
dockerfile: infra/docker/web.Dockerfile
env_file:
- .env
environment:
CHOKIDAR_USEPOLLING: 'true'
WATCHPACK_POLLING: 'true'
command: sh infra/scripts/start-web.sh
depends_on:
api:
condition: service_started
ports:
- '3000:3000'
restart: unless-stopped
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://127.0.0.1:3000').then((response) => process.exit(response.ok ? 0 : 1)).catch(() => process.exit(1))",
]
interval: 15s
timeout: 5s
retries: 10
start_period: 300s
volumes:
- .:/workspace
- workspace_node_modules:/workspace/node_modules
- pnpm_store:/pnpm/store
nginx:
image: nginx:1.27-alpine
depends_on:
web:
condition: service_started
api:
condition: service_started
ports:
- '8080:80'
restart: unless-stopped
volumes:
- ./infra/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
volumes:
postgres_data:
redis_data:
workspace_node_modules:
pnpm_store:
storage_data: