watcher/Dockerfile
timerzz dcebdb399e
All checks were successful
Build image / build (push) Successful in 1m20s
feat 前后端分离
2024-05-12 16:14:24 +08:00

16 lines
401 B
Docker

FROM golang:alpine as back
ARG GOPROXY=https://goproxy.cn,direct
WORKDIR /build
COPY . /build
RUN CGO_ENABLED=0 go build -trimpath -ldflags '-w -s' -o watcher ./main
FROM alpine:latest
ARG HTTP_PROXY=http://192.168.31.55:10809
ARG HTTPS_PROXY=http://192.168.31.55:10809
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /work
COPY --from=back /build/watcher /work/
ENTRYPOINT ["/work/watcher"]