feat(deploy): A10 MVP W2-W4 容器化+nginx 单源+compose 编排骨架

platform-app/flowable-service Dockerfile(JRE21+非root+COPY 预构建 jar+健康探针);deploy/nginx.conf(单源:serve dist+反代 /api、/flowable);deploy/docker-compose.yml(4服务 postgres+platform-app+flowable-service+nginx,healthcheck/depends_on);deploy/.env.example(prod 密钥/DB env,fail-fast);deploy/systemd/*(D3 禁Docker客户兜底);deploy/README.md。验证:docker compose config 通过(4服务+插值);docker build 待 daemon(本机未起,已诚实标注)。验证揪修 flowable-service 双数据源 FLOWABLE_JDBC_*/BIZ_JDBC_* env 漏传。.gitignore 加 deploy/.env。W1 Flyway 下一批次:当前 compose 假定 DB 已置备,尚不能从零自举。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-25 14:05:56 +08:00
parent 997d51c5a4
commit ade4c928bb
10 changed files with 305 additions and 0 deletions

45
deploy/nginx.conf Normal file
View File

@@ -0,0 +1,45 @@
# EIP4 单源托管(A10 W3)。挂载为 nginx:alpine 的 /etc/nginx/conf.d/default.conf。
# 一个源:静态 SPA(eip4-web/dist)+ 反代 /api→platform-app、/flowable→flowable-service。
# 消除 dev 的 vite proxy 依赖;切流灰度(W6)可在此用 upstream 权重双跑(eip3↔eip4)。
server {
listen 80;
server_name _;
# 附件上传/导出:放宽请求体上限(与保真层附件大小对齐,按需调)
client_max_body_size 50m;
gzip on;
gzip_types text/css application/javascript application/json image/svg+xml;
gzip_min_length 1024;
# 后端 REST(现代层 + 保真层引擎)
location /api/ {
proxy_pass http://platform-app:8084;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 130s; # 略大于 statement_timeout(120s),避免反代先于 DB 超时切断
}
# 工作流引擎(按需直达;多数流程经 platform-app 网关,故默认收窄)
location /flowable/ {
proxy_pass http://flowable-service:8089/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# 静态资源:带 hash 的构建产物可长缓存
location /assets/ {
root /usr/share/nginx/html;
expires 7d;
add_header Cache-Control "public, immutable";
}
# SPA:其余路由回退 index.html(amis 前端 history 路由)
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}
}