-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
55 lines (51 loc) · 1.23 KB
/
docker-compose.yml
File metadata and controls
55 lines (51 loc) · 1.23 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
version: '3.8'
services:
baidu-netdisk:
build:
context: .
dockerfile: Dockerfile
container_name: baidu-netdisk-rust
image: baidu-netdisk-rust:latest
ports:
- "18888:18888"
volumes:
# 配置文件挂载
- ./config:/app/config
# 下载目录挂载
- ./downloads:/app/downloads
# 会话数据挂载
- ./data:/app/data
# 日志目录挂载(新增)
- ./logs:/app/logs
# WAL 目录挂载(新增)
- ./wal:/app/wal
environment:
- RUST_LOG=info
- RUST_BACKTRACE=1
restart: unless-stopped
networks:
- baidu-network
healthcheck:
# start_period: 30s - 给 Rust 应用足够的启动时间(初始化 AppState、加载会话等)
# timeout: 5s - 增加超时时间,避免启动阶段的慢响应导致失败
test: ["CMD", "curl", "-f", "http://localhost:18888/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
# 资源限制
deploy:
resources:
limits:
cpus: '2.0'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
networks:
baidu-network:
driver: bridge
volumes:
config:
downloads:
data: