-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (66 loc) · 2.54 KB
/
Copy pathdocker-compose.yml
File metadata and controls
71 lines (66 loc) · 2.54 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
# ── Windup Docker Compose ─────────────────────────────────────────────
# 使用方式:
# 启动服务: docker compose up -d
# 查看日志: docker compose logs -f [service]
# 停止服务: docker compose down
# 清理数据: docker compose down -v (⚠️ 会删除数据库数据)
# 重新构建: docker compose up -d --build
services:
# ── 后端 API 服务 ──
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: windup-backend
restart: unless-stopped
env_file:
- .env
ports:
- "${WINDUP_PORT:-8000}:8000"
networks:
- windup-net
# ── Worker(MQ 消费:邮件 + 生成调度) ──
worker:
build:
context: ./backend
dockerfile: Dockerfile
# 三渲二出帧已交给用户浏览器(#714),worker 只做后处理,不再需要 node/Chromium/three。
# 过渡机要回退到服务端渲(WINDUP_RENDER3D_CLIENT_BAKE=0)时,把这个变量设成
# runtime-render3d 重建——两者必须同时改,只关开关不换镜像会在出帧那一步才报错。
target: ${WINDUP_WORKER_TARGET:-runtime}
container_name: windup-worker
restart: unless-stopped
env_file:
- .env
command: ["python", "-m", "windup_app.worker"]
healthcheck:
disable: true
# 4C8G:挡住 worker 把 sshd 一起 OOM。更大机器可调高。见 #690。
mem_limit: 5g
networks:
- windup-net
# ── 前端静态产物构建任务 ──
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
# 构建期烘进产物的后端地址,运行期改不动,所以放在 build.args 而非
# environment。默认相对路径 → 与页面同源 → 不产生跨域,后端不必配来源白名单。
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-/api}
container_name: windup-frontend
restart: "no"
depends_on:
- backend
volumes:
# 构建命令直接写入宿主机 nginx 的站点目录;容器退出后产物仍保留。
- /var/www/react-windup:/var/www/react-windup
networks:
- windup-net
networks:
windup-net:
driver: bridge
# 宿主机链路 MTU 是 1480(eno1),compose 自建网络不会继承 daemon 的 mtu 设置,
# 默认仍是 1500 → 大包被丢,表现为 TLS 握手超时(七牛上传域名连不上、pip 下载卡死)。
driver_opts:
com.docker.network.driver.mtu: "1450"