refactor: 更新项目引用路径从perfect-panel/ppanel-server到perfect-panel/server
Build docker and publish / build (20.15.1) (push) Failing after 6m27s
Build docker and publish / build (20.15.1) (push) Failing after 6m27s
feat: 添加版本和构建时间变量 fix: 修正短信队列类型注释错误 style: 清理未使用的代码和测试文件 docs: 更新安装文档中的下载链接 chore: 迁移数据库脚本添加日志和订阅配置
This commit is contained in:
+6
-4
@@ -4,6 +4,7 @@ FROM golang:alpine AS builder
|
||||
LABEL stage=gobuilder
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG VERSION
|
||||
ENV CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH}
|
||||
|
||||
# Combine apk commands into one to reduce layer size
|
||||
@@ -18,8 +19,9 @@ RUN go mod download
|
||||
# Copy the rest of the application code
|
||||
COPY . .
|
||||
|
||||
# Build the binary with optimization flags to reduce binary size
|
||||
RUN go build -ldflags="-s -w" -o /app/ppanel ppanel.go
|
||||
# Build the binary with version and build time
|
||||
RUN BUILD_TIME=$(date -u +"%Y-%m-%d %H:%M:%S") && \
|
||||
go build -ldflags="-s -w -X 'github.com/perfect-panel/server/pkg/constant.Version=${VERSION}' -X 'github.com/perfect-panel/server/pkg/constant.BuildTime=${BUILD_TIME}'" -o /app/ppanel ppanel.go
|
||||
|
||||
# Final minimal image
|
||||
FROM scratch
|
||||
@@ -34,11 +36,11 @@ ENV TZ=Asia/Shanghai
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/ppanel /app/ppanel
|
||||
COPY --from=builder /etc /app/etc
|
||||
COPY --from=builder /build/etc /app/etc
|
||||
|
||||
# Expose the port (optional)
|
||||
EXPOSE 8080
|
||||
|
||||
# Specify entry point
|
||||
ENTRYPOINT ["/app/ppanel"]
|
||||
CMD ["run", "--config", "etc/ppanel.yaml"]
|
||||
CMD ["run", "--config", "etc/ppanel.yaml"]
|
||||
Reference in New Issue
Block a user