-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
55 lines (53 loc) · 1.15 KB
/
docker-compose.yml
File metadata and controls
55 lines (53 loc) · 1.15 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
version: '3.8'
services:
webhooker:
build:
context: .
dockerfile: Dockerfile
container_name: webhooker
restart: unless-stopped
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- PORT=3000
# 可选:设置认证密钥
# - AUTH_SECRET=your-secret-key
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/v1/health"]
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
# 资源限制
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.1'
memory: 64M
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
# 开发环境配置
# 使用: docker-compose --profile dev up
webhooker-dev:
profiles:
- dev
build:
context: .
dockerfile: Dockerfile
target: builder
container_name: webhooker-dev
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- PORT=3000
volumes:
- ./src:/app/src:ro
command: npm run dev:node