-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
56 lines (47 loc) · 1.14 KB
/
Copy pathdocker-compose.yml
File metadata and controls
56 lines (47 loc) · 1.14 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
version: '3.8'
services:
serverstatus:
image: ghcr.io/xos/server-dash:latest
container_name: serverstatus-dashboard
restart: unless-stopped
ports:
- "80:80" # Web 界面端口
- "2222:2222" # Agent 连接端口
volumes:
- ./data:/dashboard/data
- /etc/localtime:/etc/localtime:ro
environment:
- TZ=Asia/Shanghai
- GIN_MODE=release
# 健康检查
healthcheck:
test: ["/dashboard/app", "--health-check"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# 资源限制
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
reservations:
memory: 128M
cpus: '0.1'
# 安全配置
security_opt:
- no-new-privileges:true
# 注意:由于应用需要写入数据目录,暂时不使用只读文件系统
# read_only: true
tmpfs:
- /tmp:noexec,nosuid,size=100m
# 网络配置
networks:
- serverstatus-net
networks:
serverstatus-net:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16