Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (71 loc) · 2.58 KB
/
Copy pathdocker-compose.yml
File metadata and controls
75 lines (71 loc) · 2.58 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
# docker compose for 民声智理 · 12345 AI 智能研判系统 (多城市 / 多租户 V2 生产架构)
# ============================================================
# 改动 vs 原版 (老大确认的方案):
# - 删除 caddy service (复用 langgraph-app-caddy-1)
# - 删除 postgres host port (用 stack 内网, 不占 host 端口)
# - app service 改名为 ticket-radar-app (避免跟 langgraph-app 的 `app` DNS 冲突)
# - 加入 external network langgraph-app_default (让 caddy 能解析)
#
# 部署命令 (VPS 上, 必须用 --env-file 让 ${POSTGRES_PASSWORD} 能插值):
# cd /opt/12345-stack
# docker compose --env-file .env.vps up -d
# docker compose --env-file .env.vps logs -f ticket-radar-app
#
# 首次部署 checklist (详见 DEPLOY.md):
# 1. rsync 代码到 VPS /opt/12345-stack/
# 2. cp .env.vps.example .env.vps && 编辑填入密钥
# 3. ssh root@VPS 'cd /opt/12345-stack && docker compose --env-file .env.vps up -d --build'
# 4. Caddyfile 加 vhost: <your-domain> → ticket-radar-app:3100
# 5. docker exec langgraph-app-caddy-1 caddy reload --config /etc/caddy/Caddyfile
# ============================================================
services:
postgres:
# Postgres 16 + pgvector。沿用名为 pgdata 的卷,不删数据;扩展在现有库里 CREATE EXTENSION。
image: pgvector/pgvector:pg16
container_name: 12345-postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ticket_radar
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d ticket_radar"]
interval: 5s
timeout: 3s
retries: 10
networks:
- default
app:
# Service renamed: ticket-radar-app (避免 DNS clash with langgraph-app 的 `app`)
image: ticket-radar:v0.1.2
build:
context: .
dockerfile: Dockerfile
container_name: 12345-app
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@postgres:5432/ticket_radar
NODE_ENV: production
PORT: 3100
HOSTNAME: 0.0.0.0
# 远程部署从 .env.vps 注入 OPENAI_* / EMBEDDING_* / RERANK_*
env_file:
- .env.vps
expose:
- "3100"
# No host port mapping — caddy reaches ticket-radar-app:3100 via langgraph-app_default
networks:
- default
- langgraph-app_default
volumes:
pgdata:
networks:
default:
name: 12345_default
langgraph-app_default:
external: true