-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
111 lines (105 loc) · 2.99 KB
/
docker-compose.yml
File metadata and controls
111 lines (105 loc) · 2.99 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
services:
# 前端服务(Node.js + React)
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- VITE_API_URL=http://localhost:8000
- PPT_DEMO_DIR=/app/PPT_demo
# OAuth configuration (optional - leave empty if not using OAuth)
- OAUTH_SERVER_URL=${OAUTH_SERVER_URL:-}
- VITE_APP_ID=${VITE_APP_ID:-}
- JWT_SECRET=${JWT_SECRET:-default-secret-change-in-production}
# Analytics configuration (optional - leave empty if not using analytics)
- VITE_ANALYTICS_ENDPOINT=${VITE_ANALYTICS_ENDPOINT:-}
- VITE_ANALYTICS_WEBSITE_ID=${VITE_ANALYTICS_WEBSITE_ID:-}
depends_on:
- backend
networks:
- pptagent-network
volumes:
- ./PPT_demo:/app/PPT_demo:ro
# PostgreSQL 数据库服务
db:
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/postgres:16-alpine
container_name: pptagent_db
environment:
TZ: Asia/Shanghai
POSTGRES_USER: ${POSTGRES_USER:-pptagent}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pptagent_secret_2024}
POSTGRES_DB: ${POSTGRES_DB:-pptagent_dev}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- pptagent-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pptagent -d pptagent_dev"]
interval: 10s
timeout: 5s
retries: 5
# 后端服务(Python FastAPI + PPTAgent)
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "8000:8000"
env_file:
- .env
environment:
- PPT_DEMO_DIR=/app/PPT_demo
- PPT_DEMO_CACHE_DIR=/tmp/ppt_demo_cache
depends_on:
db:
condition: service_healthy
networks:
- pptagent-network
volumes:
- ./backend:/app
- ./PPT_demo:/app/PPT_demo:ro
- ppt-demo-cache:/tmp/ppt_demo_cache
- ppt-workspace:/tmp/ppt_workspace
- /var/run/docker.sock:/var/run/docker.sock
privileged: true
# 导出工具服务(统一的 PDF/PNG/HTML/PPTX 导出)
export_tool:
build:
context: ./export_tool
dockerfile: Dockerfile
container_name: pptagent_export_tool
ports:
- "8017:8017"
env_file:
- .env
environment:
- PORT=8017
- PYTHONUNBUFFERED=1
- EXPORT_DIR=/tmp/exports
networks:
- pptagent-network
volumes:
- export-workspace:/tmp/exports
- ppt-workspace:/tmp/ppt_workspace
- ./export_tool/dom-to-pptx/material-design-icons/symbols/web:/usr/share/nginx/html/material-design-icons/symbols/web:ro
- ./export_tool/fonts:/app/fonts:ro
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8017/api/export_tool/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
volumes:
ppt-workspace:
postgres_data:
export-workspace:
ppt-demo-cache:
networks:
pptagent-network:
driver: bridge