-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
38 lines (36 loc) · 1.02 KB
/
docker-compose.yml
File metadata and controls
38 lines (36 loc) · 1.02 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
version: '3.8'
services:
k2think-api:
image: julienol/k2think2api:latest
container_name: k2think-api
ports:
- "${HOST_PORT:-8001}:8001"
volumes:
# 使用目录挂载而非文件挂载,避免文件锁定问题
- ./data:/app/data
# 或者使用命名卷(推荐用于生产环境)
# - k2think_data:/app/data
# 直接以root用户运行,简化权限管理
env_file:
- .env
environment:
- PYTHONUNBUFFERED=1
- PYTHONIOENCODING=utf-8
- PYTHONLEGACYWINDOWSSTDIO=0
- LC_ALL=C.UTF-8
- LANG=C.UTF-8
# 更新配置文件路径指向data目录
- TOKENS_FILE=/app/data/tokens.txt
- ACCOUNTS_FILE=/app/data/accounts.txt
restart: unless-stopped
# 健康检查
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# 可选:使用命名卷(推荐用于生产环境)
# volumes:
# k2think_data:
# driver: local