整栈 docker compose up 对内置空 postgres 真起验证(本地 daemon + PG 15.15), 揪修并文档化两处: - postgres-init/01-create-schemas.sql(新):首次初始化预建 eip3+flowable schema。 原空库起 flowable-service 报 "no schema has been selected to create in"—— platform-app 的 Flyway 会自建 eip3,但 flowable 的 Liquibase 不自建 schema。 - docker-compose.yml:postgres 挂载 postgres-init/;刷新过时头注释 (W1 Flyway 已含,不再"假定 DB 已置备"自举平台表)。 - README:验证状态改为 2026-06-25 本地真验记录—— platform-app 在 prod profile + W1 Flyway 启动自建 eip3 落 9 张 sys_* 表、 readiness UP、nginx 单源反代 /api→401(prod 严格认证链生效); flowable-service 空演示库 by-design 无法起(databaseSchemaUpdate=false 红线, 需预置 Flowable 6.8.1 引擎 DDL),已显式文档化边界。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
84 lines
3.1 KiB
YAML
84 lines
3.1 KiB
YAML
# EIP4 生产编排骨架(A10 W4)。四服务:nginx 单源 + platform-app + flowable-service + postgres。
|
|
#
|
|
# 用法(见 deploy/README.md):
|
|
# 1) 先产 jar: mvn -pl platform-app,flowable-service -am package -DskipTests
|
|
# 2) 先产前端: (cd ../../eip4-web && npm ci && npm run build) # 生成 eip4-web/dist
|
|
# 3) 配 .env: cp deploy/.env.example deploy/.env && 改强随机密钥/DB
|
|
# 4) 起栈: docker compose -f deploy/docker-compose.yml --env-file deploy/.env up -d --build
|
|
#
|
|
# 边界(见 A10 design D2/D6):保真层跑【客户既有 eip3 库】,生产请把 EIP4_DB_URL 指向客户 PG;
|
|
# 下面的 postgres 服务仅自测/演示用(空库)。平台表(sys_*)由 platform-app 的 W1 Flyway
|
|
# 在启动时自建(含自建 eip3 schema);flowable 的 Liquibase 不自建 schema,故演示库经
|
|
# postgres-init/ 预建 eip3+flowable 两 schema(见该脚本注释)。生产指客户库时无需这些。
|
|
services:
|
|
postgres: # D6:仅自测演示;生产用客户 PG,把 EIP4_DB_URL 指过去并删本服务
|
|
image: postgres:15
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-eip4}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-eip4}
|
|
POSTGRES_DB: ${POSTGRES_DB:-eip4}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
- ./postgres-init:/docker-entrypoint-initdb.d:ro # 首次初始化预建 eip3+flowable schema
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-eip4}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 12
|
|
networks: [eip4]
|
|
|
|
platform-app:
|
|
build:
|
|
context: ../platform-app
|
|
environment:
|
|
SPRING_PROFILES_ACTIVE: prod
|
|
SERVER_PORT: 8084
|
|
EIP4_AUTH_JWT_SECRET: ${EIP4_AUTH_JWT_SECRET} # 强制(application-prod.yml 无默认,缺失 fail-fast)
|
|
EIP4_DB_URL: ${EIP4_DB_URL}
|
|
EIP4_DB_USERNAME: ${EIP4_DB_USERNAME}
|
|
EIP4_DB_PASSWORD: ${EIP4_DB_PASSWORD}
|
|
EIP4_FILE_ROOT: /data/files
|
|
volumes:
|
|
- filedata:/data/files
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
networks: [eip4]
|
|
restart: unless-stopped
|
|
|
|
flowable-service:
|
|
build:
|
|
context: ../flowable-service
|
|
environment:
|
|
SERVER_PORT: 8089
|
|
# flowable-service 双数据源(env 驱动):ACT_ 引擎库 + biz 客户库(候选人解析直查组织表)
|
|
FLOWABLE_JDBC_URL: ${FLOWABLE_JDBC_URL}
|
|
FLOWABLE_JDBC_USER: ${FLOWABLE_JDBC_USER}
|
|
FLOWABLE_JDBC_PASS: ${FLOWABLE_JDBC_PASS}
|
|
BIZ_JDBC_URL: ${BIZ_JDBC_URL}
|
|
BIZ_JDBC_USER: ${BIZ_JDBC_USER}
|
|
BIZ_JDBC_PASS: ${BIZ_JDBC_PASS}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
networks: [eip4]
|
|
restart: unless-stopped
|
|
|
|
nginx: # 单源:serve 前端 dist + 反代 /api、/flowable
|
|
image: nginx:alpine
|
|
ports:
|
|
- "${HTTP_PORT:-80}:80"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
- ${WEB_DIST:-../../eip4-web/dist}:/usr/share/nginx/html:ro
|
|
depends_on: [platform-app, flowable-service]
|
|
networks: [eip4]
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
pgdata:
|
|
filedata:
|
|
|
|
networks:
|
|
eip4:
|