watcher/Dockerfile

24 lines
633 B
Docker
Raw Normal View History

2024-04-10 17:36:56 +08:00
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
2024-04-13 10:59:27 +08:00
ARG HTTP_PROXY=http://192.168.31.55:10809
ARG HTTPS_PROXY=http://192.168.31.55:10809
2024-04-10 17:36:56 +08:00
COPY . /build
WORKDIR /build/wwwroot
2024-04-13 10:59:27 +08:00
RUN bun install && bun run build
2024-04-10 17:36:56 +08:00
FROM alpine:latest
2024-04-13 10:37:57 +08:00
ARG HTTP_PROXY=http://192.168.31.55:10809
ARG HTTPS_PROXY=http://192.168.31.55:10809
2024-04-10 17:36:56 +08:00
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /work
COPY --from=back /build/watcher /work/
COPY --from=front /build/wwwroot/dist /work/dist/
2024-04-10 17:36:56 +08:00
ENTRYPOINT ["/work/watcher"]