refactor: 重构部署脚本为 dev/build_docker/remote/build 四脚本并统一单域名容器模型
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env sh
|
||||
# Artveris API 容器启动脚本:
|
||||
# - 已配置 DATABASE_URL:自动执行 Prisma 迁移建表 + 幂等初始化超管/基础设置,再启动服务;
|
||||
# - 未配置 DATABASE_URL:直接启动,由首次安装向导完成初始化。
|
||||
set -e
|
||||
cd /app/apps/api
|
||||
|
||||
if [ -n "${DATABASE_URL:-}" ]; then
|
||||
echo "[entrypoint] prisma migrate deploy ..."
|
||||
node -e "require('child_process').execFileSync(process.execPath,[require.resolve('prisma/build/index.js'),'migrate','deploy','--schema','prisma/schema.prisma'],{stdio:'inherit'})"
|
||||
echo "[entrypoint] 初始化超管与基础设置 ..."
|
||||
node prisma/seed-production.js || echo "[entrypoint] seed-production 跳过/失败(忽略,不阻塞启动)"
|
||||
else
|
||||
echo "[entrypoint] 未设置 DATABASE_URL,将进入首次安装向导模式。"
|
||||
fi
|
||||
|
||||
exec node dist/main.js
|
||||
Reference in New Issue
Block a user