优化部署流程

This commit is contained in:
eafonyang
2026-06-30 13:50:29 +08:00
parent a52adf7e27
commit 23f712cf86
9 changed files with 362 additions and 204 deletions
+1 -13
View File
@@ -1,15 +1,3 @@
FROM golang:1.24-alpine AS builder
RUN apk add --no-cache git
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /server ./cmd/server
FROM alpine:3.20
RUN apk add --no-cache ca-certificates tzdata \
@@ -18,7 +6,7 @@ RUN apk add --no-cache ca-certificates tzdata \
WORKDIR /app
COPY --from=builder /server .
COPY server .
EXPOSE 8080