Files
becomer e3f8dc8aac
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/build Pipeline is running
fix: set GOPROXY to goproxy.cn for Go module downloads
proxy.golang.org is not reachable from this server; use goproxy.cn mirror.
2026-07-01 00:39:04 +08:00

18 lines
342 B
Docker

FROM golang:1.25-alpine AS backend-builder
WORKDIR /build
ENV GOPROXY=https://goproxy.cn,direct
COPY . .
RUN go build -ldflags="-s -w" -o bin/server
RUN apk add --no-cache upx
RUN upx --best --lzma bin/server
FROM alpine:latest
COPY --from=backend-builder /build/bin/server /app/server
WORKDIR /app
EXPOSE 8080
RUN ls -a
CMD ["./server"]