feat: 新增 Docker 容器化部署,支持 Docker Hub 镜像发布
Some checks failed
Docker / docker (push) Has been cancelled

多阶段 Dockerfile、Compose、/health 探活与 JIANG13_* 环境变量;
entrypoint 自动修正 /data 卷权限,适配 1Panel 等平台;更新 README 部署文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-23 18:30:53 +08:00
parent 4f85a86077
commit c07d1fd2bd
16 changed files with 398 additions and 13 deletions

View File

@@ -56,6 +56,18 @@ func (h *Handlers) APIBoards(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"boards": boards})
}
// APIHealth 健康检查(容器探活 / 负载均衡)
func (h *Handlers) APIHealth(c *gin.Context) {
if err := model.PingDB(); err != nil {
c.JSON(http.StatusServiceUnavailable, gin.H{
"status": "unavailable",
"error": err.Error(),
})
return
}
c.JSON(http.StatusOK, gin.H{"status": "ok"})
}
// APIStats 论坛概览统计
func (h *Handlers) APIStats(c *gin.Context) {
var userCount, postCount, boardCount int64