更新到 Go 1.25.6
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Failing after 4m30s

This commit is contained in:
2026-01-19 17:17:27 +08:00
parent 919d4350d0
commit 08736d2692
3 changed files with 6 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
# ================================ # ================================
# 阶段 1: 构建阶段 # 阶段 1: 构建阶段
# ================================ # ================================
FROM golang:1.23.4-alpine AS builder FROM golang:1.25.6-alpine AS builder
# 设置工作目录 # 设置工作目录
WORKDIR /build WORKDIR /build
@@ -14,7 +14,6 @@ COPY go.mod go.sum ./
# 使用国内 Go 代理加速依赖下载 # 使用国内 Go 代理加速依赖下载
ENV GOPROXY=https://goproxy.cn,direct ENV GOPROXY=https://goproxy.cn,direct
ENV GOTOOLCHAIN=auto
RUN go mod download RUN go mod download
@@ -22,13 +21,13 @@ RUN go mod download
COPY . . COPY . .
# 编译 API 服务(静态链接) # 编译 API 服务(静态链接)
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOTOOLCHAIN=auto go build \ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags="-w -s" \ -ldflags="-w -s" \
-o /build/api \ -o /build/api \
cmd/api/main.go cmd/api/main.go
# 下载 golang-migrate 工具 # 下载 golang-migrate 工具
RUN GOTOOLCHAIN=auto go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest RUN go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest
# ================================ # ================================
# 阶段 2: 运行阶段 # 阶段 2: 运行阶段

View File

@@ -1,7 +1,7 @@
# ================================ # ================================
# 阶段 1: 构建阶段 # 阶段 1: 构建阶段
# ================================ # ================================
FROM golang:1.23.4-alpine AS builder FROM golang:1.25.6-alpine AS builder
# 设置工作目录 # 设置工作目录
WORKDIR /build WORKDIR /build
@@ -14,7 +14,6 @@ COPY go.mod go.sum ./
# 使用国内 Go 代理加速依赖下载 # 使用国内 Go 代理加速依赖下载
ENV GOPROXY=https://goproxy.cn,direct ENV GOPROXY=https://goproxy.cn,direct
ENV GOTOOLCHAIN=auto
RUN go mod download RUN go mod download
@@ -22,7 +21,7 @@ RUN go mod download
COPY . . COPY . .
# 编译 Worker 服务(静态链接) # 编译 Worker 服务(静态链接)
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOTOOLCHAIN=auto go build \ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \
-ldflags="-w -s" \ -ldflags="-w -s" \
-o /build/worker \ -o /build/worker \
cmd/worker/main.go cmd/worker/main.go

2
go.mod
View File

@@ -1,6 +1,6 @@
module github.com/break/junhong_cmp_fiber module github.com/break/junhong_cmp_fiber
go 1.23 go 1.25
require ( require (
github.com/bytedance/sonic v1.14.2 github.com/bytedance/sonic v1.14.2