watcher/Dockerfile
timerzz 35db85ba88
Some checks failed
Build image / build (push) Has been cancelled
feat 去掉构建中的proxy
2024-04-13 10:03:25 +08:00

20 lines
462 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 oven/bun:1 as front
COPY . /build
WORKDIR /build/wwwroot
RUN bun install && bun run build
FROM alpine:latest
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /work
COPY --from=back /build/watcher /work/
COPY --from=front /build/wwwroot/dist /work/dist/
ENTRYPOINT ["/work/watcher"]