修复错误

This commit is contained in:
yml2213
2026-07-22 13:06:06 +08:00
parent 37635e0d64
commit 56e9f0cdb4
5 changed files with 77 additions and 41 deletions
+7 -7
View File
@@ -2,26 +2,26 @@ FROM golang:1.26-alpine AS builder
WORKDIR /app
# Copy Go files
# 复制 Go 依赖文件 / Copy Go dependency files
COPY backend/go.mod backend/go.sum ./
RUN go mod download
COPY backend ./backend
WORKDIR /app/backend
# Build the Go binary
# 构建 Go 二进制文件 / Build Go binary
RUN CGO_ENABLED=0 GOOS=linux go build -o /server ./cmd/server
# Final stage
# 最终运行镜像 / Runtime image
FROM alpine:latest
RUN apk --no-cache add ca-certificates tzdata
RUN apk --no-cache add ca-certificates tzdata curl
WORKDIR /app
COPY --from=builder /server ./server
# Expose port
# 暴露服务端口 / Expose service port
EXPOSE 8080
# Run the server
CMD ["./server"]
# 启动服务 / Run server
CMD ["./server"]