Files
ssw-ontology/build.sh
T
admin 993f74c2b2 feat: Docker 单镜像分发 + 默认端口统一 8081 + seed 极简化
新增 Dockerfile + docker/entrypoint.sh:
- 基础 crpi-.../ssw188/postgres:16-alpine + ontology 二进制,单镜像
- 默认端口 8081 / 库 ssw-ontology / 用户 ssw / 密码 ssw
- /data/pg 自动挂 PG 数据,/data/archive 挂文档根目录
- trap 收尸保证 PG + ontology 同生命周期

seed 极简化为 1 个对象类型「合作企业」+ 3 条示例
(尚数网/腾讯/阿里巴巴),便于演示也便于清理。

默认 HTTP_PORT 统一为 8081(覆盖 server/config.go、run.sh、
vite.config.js、importer/import-from-xeo.js、docs/README.md、
docs/USAGE.md、docs/IMPORT.md、.env.example 等所有文档/代码)。

docs/README.md / .env.example 默认 DATABASE_URL 改为
ssw/[email protected]:5432/ssw-ontology(与 Docker 镜像自带 PG 一致);
run.sh 删 dacli 硬编码 fallback,改从 .env 读(不存在则报错退出)。

README 重整:分「方式 A Docker 镜像 / 方式 B 本机 ./run.sh」,
新增 AI 智能导入(-e AI_*)与管理接口鉴权(-e MANAGER_API_KEY)说明。
2026-08-13 15:59:27 +08:00

27 lines
735 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 尚数网本体管理平台 - 本地构建脚本
# 负责:前端构建 + 后端编译(产物为 bin/server,直接运行,无需 docker)
set -euo pipefail
cd "$(dirname "$0")"
echo "==> [1/3] 构建前端 (Vue -> web/dist)"
cd web
npm install
npm run build
cd ..
echo "==> [2/3] 同步前端产物到 server/webroot (Go embed)"
rm -rf server/webroot
cp -r web/dist server/webroot
echo "==> [3/3] 编译后端 (本机运行用)"
cd server
go build -o ../bin/server .
cd ..
echo ""
echo "构建完成 ✅"
echo " - 运行 : ./run.sh (数据库/AI 等配置从仓库根 .env 读取;不存在可参考 .env.example)"
echo " - 或 : 直接 DATABASE_URL=... ./bin/server (用 shell 环境覆盖)"