watcher/Dockerfile
timerzz 9e1de87c89
Some checks failed
Build image / build (push) Failing after 57s
fix 修复构建镜像tag不正确
2024-04-13 10:57:17 +08:00

22 lines
577 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 -c /build/wwwroot/bunfig.toml && bun run build
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/
COPY --from=front /build/wwwroot/dist /work/dist/
ENTRYPOINT ["/work/watcher"]