Files
message-pusher/Dockerfile
T

26 lines
442 B
Docker
Raw Normal View History

2022-07-30 00:51:34 +08:00
FROM node:16 as builder
WORKDIR /build
2022-11-11 15:35:02 +08:00
COPY ./web .
2022-07-30 00:51:34 +08:00
RUN npm install
2022-11-11 15:35:02 +08:00
RUN npm run build
FROM golang AS builder2
ENV GO111MODULE=on \
CGO_ENABLED=1 \
GOOS=linux \
GOARCH=amd64
2022-07-30 00:51:34 +08:00
WORKDIR /build
2022-11-11 15:35:02 +08:00
COPY . .
COPY --from=builder /build/build ./web/build
RUN go mod download
RUN go build -ldflags "-s -w" -o message-pusher
FROM scratch
ENV PORT=3000
COPY --from=builder2 /build/message-pusher /
2022-07-30 00:51:34 +08:00
EXPOSE 3000
2022-11-11 15:35:02 +08:00
ENTRYPOINT ["/message-pusher"]