ci/cd调整

This commit is contained in:
2026-06-10 15:37:11 +08:00
parent 0b5dec6965
commit 1b5eba34d5
14 changed files with 31 additions and 35 deletions

View File

@@ -1,27 +1,24 @@
# 最小化Docker镜像
FROM busybox:uclibc
# 阶段1: 构建
FROM golang:alpine AS builder
WORKDIR /app
RUN apk add --no-cache git ca-certificates tzdata
# 复制时区数据
COPY timezone/localtime /etc/localtime
COPY timezone/timezone /etc/timezone
COPY timezone/Shanghai /usr/share/zoneinfo/Asia/Shanghai
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 复制预构建的二进制文件和配置文件
COPY app ./main
COPY manifest/config/config.yaml ./manifest/config/config.yaml
COPY manifest/config/config-dev.yaml ./manifest/config/config-dev.yaml
COPY manifest/config/config-master.yaml ./manifest/config/config-master.yaml
COPY resource ./resource
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
ENV CGO_ENABLED=0
ENV GOTOOLCHAIN=auto
WORKDIR /build
# 创建日志目录
RUN mkdir -p /logs /app/resource/log/run /app/resource/log/server
COPY . .
RUN go mod download && go mod tidy
RUN go build -ldflags="-s -w" -o main ./main.go
# 添加执行权限
RUN chmod +x /app/main
EXPOSE 8808
# 使用root用户运行
CMD ["./main"]

View File

@@ -8,7 +8,7 @@
package system
import (
"gitea.com/red-future/common/beans"
"gitea.redpowerfuture.com/red-future/common/beans"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"
commonApi "github.com/tiger1103/gfast/v3/api/v1/common"

BIN
app

Binary file not shown.

2
go.mod
View File

@@ -3,7 +3,7 @@ module github.com/tiger1103/gfast/v3
go 1.26.0
require (
gitea.com/red-future/common v0.0.21
gitea.redpowerfuture.com/red-future/common v0.0.23
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef
github.com/casbin/casbin/v2 v2.42.0
github.com/gogf/gf/contrib/drivers/pgsql/v2 v2.10.0

4
go.sum
View File

@@ -1,6 +1,6 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
gitea.com/red-future/common v0.0.21 h1:8w30HmCVmFG/hphH3ODJs1KxDEGmRpq+/PXI0pQjJKc=
gitea.com/red-future/common v0.0.21/go.mod h1:6/nqIucVzmjOyqDTIq71feYBXXFNBy0rFwzaQ0/Ueoo=
gitea.redpowerfuture.com/red-future/common v0.0.23 h1:xieoA00iKOCDm5SO9iXn+cSyMKBAlZwI0fuEVPWrHLg=
gitea.redpowerfuture.com/red-future/common v0.0.23/go.mod h1:50U1Xi+Ie56z09S5LQbZvaken0Mxv3OeS9LgR7U/ZRY=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=

View File

@@ -12,9 +12,9 @@ import (
"fmt"
"time"
"gitea.com/red-future/common/beans"
"gitea.com/red-future/common/http"
"gitea.com/red-future/common/utils"
"gitea.redpowerfuture.com/red-future/common/beans"
"gitea.redpowerfuture.com/red-future/common/http"
"gitea.redpowerfuture.com/red-future/common/utils"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gtime"

View File

@@ -10,8 +10,8 @@ package sysDept
import (
"context"
"database/sql"
"gitea.com/red-future/common/beans"
"gitea.com/red-future/common/utils"
"gitea.redpowerfuture.com/red-future/common/beans"
"gitea.redpowerfuture.com/red-future/common/utils"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/text/gstr"
"github.com/gogf/gf/v2/util/gconv"

View File

@@ -9,8 +9,8 @@ package sysRole
import (
"context"
"gitea.com/red-future/common/beans"
"gitea.com/red-future/common/utils"
"gitea.redpowerfuture.com/red-future/common/beans"
"gitea.redpowerfuture.com/red-future/common/utils"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/util/gconv"

View File

@@ -11,8 +11,8 @@ import (
"context"
"fmt"
"gitea.com/red-future/common/beans"
"gitea.com/red-future/common/utils"
"gitea.redpowerfuture.com/red-future/common/beans"
"gitea.redpowerfuture.com/red-future/common/utils"
"github.com/gogf/gf/v2/container/gset"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/errors/gerror"

View File

@@ -13,8 +13,8 @@ import (
"errors"
"fmt"
"gitea.com/red-future/common/beans"
"gitea.com/red-future/common/utils"
"gitea.redpowerfuture.com/red-future/common/beans"
"gitea.redpowerfuture.com/red-future/common/utils"
"github.com/gogf/gf/v2/container/gset"
"github.com/gogf/gf/v2/database/gdb"
"github.com/gogf/gf/v2/frame/g"

View File

@@ -1,7 +1,7 @@
package main
import (
_ "gitea.com/red-future/common/http"
_ "gitea.redpowerfuture.com/red-future/common/http"
_ "github.com/gogf/gf/contrib/drivers/pgsql/v2"
_ "github.com/gogf/gf/contrib/nosql/redis/v2"
"github.com/gogf/gf/v2/os/gctx"

Binary file not shown.

Binary file not shown.

View File

@@ -1 +0,0 @@
Asia/Shanghai