ci: Docker 打包 + Gitea Actions 自动部署到 132
- Dockerfile 四阶段:web/admin 前端构建 → go 静态编译(embed 双前端) → alpine 运行镜像(53MB, 非 root, Asia/Shanghai) - docker-compose.yml:132 部署用,暴露 8090,env_file 读本机 .env,带 healthcheck - .gitea/workflows/deploy.yml:push dev → runner 构建 → docker save|gzip → sshpass scp → 132 load+up → 健康检查 - deploy/nginx-site.sundynix.cn.conf:公网 nginx 反代(穿透回源 site.sundynix.cn) - .env.production.example + deploy/README.md:部署手册(secrets、127:3307 数据库、证书) - 已本地验证:镜像构建通过 + 容器冒烟(健康/用户端/管理端/logo/RSS/登录)全绿 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# 部署机 192.168.100.132:/home/workspace/sundynix-site/.env
|
||||
# 一次性手动放置,CI 不覆盖它(敏感信息不进流水线)
|
||||
# compose 的 env_file 读取本文件
|
||||
|
||||
# 内网 MySQL(127 那台),库名 sundynix_site
|
||||
SUNDYNIX_DB=root:sundynix@tcp(192.168.100.127:3307)/sundynix_site?charset=utf8mb4&parseTime=True&loc=Local
|
||||
|
||||
# 监听地址(容器内固定 8090,勿改,与 compose ports 对应)
|
||||
SUNDYNIX_ADDR=:8090
|
||||
|
||||
# 管理端账号(务必改掉默认)
|
||||
SUNDYNIX_ADMIN_USER=admin
|
||||
SUNDYNIX_ADMIN_PASS=请改成强密码
|
||||
|
||||
# JWT 密钥(openssl rand -hex 32 生成一个填进来)
|
||||
SUNDYNIX_JWT_SECRET=请填32字节以上随机串
|
||||
|
||||
# 雪花节点号(多实例时区分)
|
||||
SUNDYNIX_NODE_ID=1
|
||||
|
||||
# 对外站点地址(RSS / OG 链接用)
|
||||
SUNDYNIX_SITE_URL=https://site.sundynix.cn
|
||||
|
||||
# 版本回退(gitea 无 release 时官网显示的版本)
|
||||
SUNDYNIX_FALLBACK_VERSION=v0.1.2
|
||||
Reference in New Issue
Block a user