-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
62 lines (54 loc) · 1.21 KB
/
docker-compose.yml
File metadata and controls
62 lines (54 loc) · 1.21 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
services:
al1s-bot:
build:
context: .
dockerfile: Dockerfile
container_name: al1s-bot
restart: always
# 挂载配置文件和数据
volumes:
- ./config.toml:/app/config.toml:ro
- ./logs:/app/logs
- ./data:/app/data
- npm-cache:/app/.npm
- npm-global:/app/.npm-global
# 环境变量
environment:
- PYTHONUNBUFFERED=1
- PYTHONDONTWRITEBYTECODE=1
- TZ=Asia/Shanghai
# 资源限制 - 增加内存以支持npm安装
# deploy:
# resources:
# limits:
# memory: 1G
# cpus: "1.0"
# reservations:
# memory: 512M
# cpus: "0.5"
# 网络配置
networks:
- al1s-bot-network
# 健康检查 - 验证Python和Node.js环境
healthcheck:
test: ["CMD", "sh", "-c", "python -c 'import sys; sys.exit(0)' && node --version"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# 日志配置
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
al1s-bot-network:
driver: bridge
volumes:
logs:
driver: local
npm-cache:
driver: local
npm-global:
driver: local