Files
message-pusher/Dockerfile
T

27 lines
477 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
2022-11-23 16:03:51 +08:00
2022-11-11 15:35:02 +08:00
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
2022-11-23 16:03:51 +08:00
RUN go build -ldflags "-s -w -extldflags '-static'" -o message-pusher
2022-11-11 15:35:02 +08:00
FROM alpine
2022-11-11 15:35:02 +08:00
ENV PORT=3000
COPY --from=builder2 /build/message-pusher /
2022-07-30 00:51:34 +08:00
EXPOSE 3000
2022-11-23 16:03:51 +08:00
WORKDIR /data
2022-11-11 15:35:02 +08:00
ENTRYPOINT ["/message-pusher"]