-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (61 loc) · 1.4 KB
/
docker-compose.yml
File metadata and controls
65 lines (61 loc) · 1.4 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
x-app-image: &app-image ${APP_IMAGE:-letletme-data:local}
services:
api:
image: *app-image
build:
context: .
target: runner
command: bun dist/index.js
env_file: .env.deploy
environment:
- TZ=Asia/Shanghai
ports:
- "3000:3000"
volumes:
- ./log:/app/logs
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"bun",
"-e",
"fetch('http://127.0.0.1:3000/health').then((res) => { if (!res.ok) process.exit(1); }).catch(() => process.exit(1))",
]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
worker:
image: *app-image
build:
context: .
target: runner
command: bun dist/worker.js
env_file: .env.deploy
environment:
- TZ=Asia/Shanghai
volumes:
- ./log:/app/logs
depends_on:
redis:
condition: service_healthy
restart: unless-stopped
redis:
image: redis:7.4-alpine
env_file:
- .env.deploy
command: ["sh", "-c", "exec redis-server --requirepass \"$${REDIS_PASSWORD:-changeme}\""]
volumes:
- redis-data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "sh", "-c", "redis-cli -a \"$${REDIS_PASSWORD:-changeme}\" PING"]
interval: 10s
timeout: 3s
retries: 5
volumes:
redis-data: