-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.basic.yml
More file actions
87 lines (76 loc) · 2.64 KB
/
Copy pathdocker-compose.basic.yml
File metadata and controls
87 lines (76 loc) · 2.64 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# =============================================================================
# PromiseLink 基础版 Docker Compose
# SQLite单文件数据库,零外部依赖
# 适用于个人本地部署 + 专业版 relay 中继
#
# 两种使用模式:
#
# 【模式A:纯基础版(无专业版)】
# 1. cp .env.basic.example .env.basic
# 2. 编辑 .env.basic 填入 LLM_API_KEY
# 3. docker compose -f docker-compose.basic.yml up -d --build
# 4. 浏览器打开 http://localhost:8000
#
# 【模式B:基础版 + 专业版 relay(种子客户推荐)】
# 1. 运行 bash scripts/install_basic.sh,按提示输入许可证密钥
# 2. 脚本自动配置 .env.basic 并启动容器
# 3. 浏览器打开 http://localhost:8000(本地直连)
# 4. 手机扫码小程序,小程序经云端网关 WSS 中继访问本地数据
#
# 专业版 relay 关键环境变量(在 .env.basic 中配置):
# RELAY_GATEWAY_URL=https://www.promiselink.cn 云端网关地址(SSL 证书已覆盖)
# PRO_LICENSE_KEY=PL-PRO-xxxx-xxxx-xxxx 许可证密钥
# RELAY_WSS_ENABLED=true 启用WSS长连接
# RELAY_LOCAL_API_URL=http://localhost:8000 本地API地址(WSS中继转发目标)
# =============================================================================
version: "3.8"
services:
promiselink-api:
build:
context: .
dockerfile: Dockerfile
image: promiselink:basic
container_name: promiselink-api
ports:
- "8000:8000"
env_file:
- .env.basic
environment:
- APP_ENV=production
- DATABASE_URL=sqlite+aiosqlite:///data/promiselink.db
- REDIS_ENABLED=false
# 专业版 relay 配置(可选,未配置则纯基础版模式)
- RELAY_WSS_ENABLED=${RELAY_WSS_ENABLED:-false}
- RELAY_GATEWAY_URL=${RELAY_GATEWAY_URL:-}
- PRO_LICENSE_KEY=${PRO_LICENSE_KEY:-}
- RELAY_LOCAL_API_URL=http://localhost:8000
volumes:
- ./data:/data
- ./frontend/dist:/app/static:ro
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/v1/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
reservations:
cpus: "0.25"
memory: 128M
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
tag: "promiselink-{{.Name}}"
networks:
- promiselink-basic-net
restart: unless-stopped
networks:
promiselink-basic-net:
driver: bridge
name: promiselink-basic