Dockerfile 442 B

12345678910111213141516171819202122232425
  1. FROM node:16 as builder
  2. WORKDIR /build
  3. COPY ./web .
  4. RUN npm install
  5. RUN npm run build
  6. FROM golang AS builder2
  7. ENV GO111MODULE=on \
  8. CGO_ENABLED=1 \
  9. GOOS=linux \
  10. GOARCH=amd64
  11. WORKDIR /build
  12. COPY . .
  13. COPY --from=builder /build/build ./web/build
  14. RUN go mod download
  15. RUN go build -ldflags "-s -w" -o message-pusher
  16. FROM scratch
  17. ENV PORT=3000
  18. COPY --from=builder2 /build/message-pusher /
  19. EXPOSE 3000
  20. ENTRYPOINT ["/message-pusher"]