接入Docker蓝绿部署:自包含多阶段构建、配置外部化

- 新增根目录Dockerfile:多阶段构建(Vue前端 + Go后端),包含main.go依赖的
  internal/packed资源打包步骤(原来依赖gf build外部产出,未提交进仓库)
- 新增server/manifest/config/config.template:数据库/Redis连接串、
  token密钥等敏感配置改为占位符,运行时通过entrypoint.sh用envsubst生成
  真正的config.yaml,不再需要在仓库里维护包含真实密码的config.yaml
- entrypoint.sh改为先渲染配置再启动
- 修复web/pnpm-lock.yaml与package.json不同步的问题(有依赖被加进
  package.json但没重新生成锁文件)
- 新增web/pnpm-workspace.yaml:较新版本pnpm默认禁止依赖包运行构建脚本
  (供应链安全特性),需要显式在这里批准esbuild/@swc/core等的构建脚本,
  否则CI环境下frozen-lockfile安装会直接失败
This commit is contained in:
Your Name
2026-08-12 11:26:13 +08:00
parent 331a55751d
commit f711fec00b
5 changed files with 998 additions and 326 deletions
+11 -4
View File
@@ -1,5 +1,12 @@
#!/bin/bash
#!/bin/sh
set -e
cd /app && ./hotgo &
echo "hotgo start all server.."
tail -f /dev/null
cd /app
# Render the real config from the template using only the specific env vars we
# expect — avoids accidentally substituting anything else that might contain a
# literal '$' in the YAML.
envsubst '$MYSQL_DSN $REDIS_ADDR $REDIS_DB $REDIS_PASSWORD $TOKEN_SECRET_KEY' \
< manifest/config/config.template > manifest/config/config.yaml
exec ./hotgo