refact: update dockerfile

This commit is contained in:
liuyuanchuang
2025-12-11 11:22:56 +08:00
parent 0bc77f61e2
commit ea0f5d8765

View File

@@ -7,8 +7,13 @@ WORKDIR /app
# Copy source code # Copy source code
COPY . . COPY . .
ENV GOPROXY=https://goproxy.cn,direct
ENV GOSUMDB=off
# Build binary # Build binary
RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor -o doc_ai ./main.go RUN go mod download && \
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o doc_ai ./main.go
# Runtime stage # Runtime stage
FROM alpine:latest FROM alpine:latest