Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c7c10c7c17 | |||
| ee54689fe9 | |||
| f1b01ec18f | |||
| d271a786d2 | |||
| 005d0aa683 |
+8
-5
@@ -1,7 +1,10 @@
|
||||
# Build stage
|
||||
FROM golang:1.23-alpine AS builder
|
||||
FROM golang:1.24-alpine AS builder
|
||||
|
||||
RUN apk add --no-cache git
|
||||
ENV GOTOOLCHAIN=auto
|
||||
|
||||
# Install build dependencies for SQLite3
|
||||
RUN apk add --no-cache git gcc musl-dev
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -13,10 +16,10 @@ RUN go mod download
|
||||
COPY server/ ./
|
||||
COPY agent/ ../agent/
|
||||
|
||||
# Build server
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /nuyue-server ./cmd/server
|
||||
# Build server with CGO enabled for SQLite3
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w -linkmode external -extldflags '-static'" -o /nuyue-server ./cmd/server
|
||||
|
||||
# Build agent
|
||||
# Build agent (no CGO needed)
|
||||
RUN cd ../agent && CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /nuyue-agent ./cmd/agent
|
||||
|
||||
# Runtime stage
|
||||
|
||||
@@ -201,9 +201,8 @@ func setupRouter(app *Application) *gin.Engine {
|
||||
})
|
||||
})
|
||||
|
||||
// API v1
|
||||
// 安装向导路由(未安装时)
|
||||
if !app.Config.IsInstalled() {
|
||||
// 安装向导(未安装时可用)
|
||||
installRepo := install.NewRepository(app.DB)
|
||||
installSvc := install.NewService(installRepo, "./config.yaml")
|
||||
installHandler := install.NewHandler(installSvc)
|
||||
@@ -215,17 +214,5 @@ func setupRouter(app *Application) *gin.Engine {
|
||||
// TODO: 添加其他模块路由
|
||||
}
|
||||
|
||||
// 安装页面
|
||||
r.GET("/install", func(c *gin.Context) {
|
||||
if app.Config.IsInstalled() {
|
||||
c.Redirect(http.StatusFound, "/login")
|
||||
return
|
||||
}
|
||||
// TODO: 返回前端安装页面
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"message": "安装向导页面(前端待实现)",
|
||||
})
|
||||
})
|
||||
|
||||
return r
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user