chore(deploy): 完成 #35 部署准备

This commit is contained in:
root
2026-03-04 18:42:40 +08:00
parent 3301acf6e6
commit cc775dff45
5 changed files with 168 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
FROM golang:1.23-alpine AS builder
WORKDIR /app
RUN apk add --no-cache git ca-certificates
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /wx_service ./cmd/api
FROM alpine:3.20
WORKDIR /app
RUN apk add --no-cache ca-certificates wget && update-ca-certificates
COPY --from=builder /wx_service /app/wx_service
COPY .env /app/.env
EXPOSE 8080
CMD ["/app/wx_service"]