Dockerfile 577 B

123456789101112131415161718192021222324252627
  1. FROM node:16 as builder
  2. WORKDIR /build
  3. COPY ./web .
  4. COPY ./VERSION .
  5. RUN npm install
  6. RUN REACT_APP_VERSION=$(cat VERSION) npm run build
  7. FROM golang AS builder2
  8. ENV GO111MODULE=on \
  9. CGO_ENABLED=1 \
  10. GOOS=linux \
  11. GOARCH=amd64
  12. WORKDIR /build
  13. COPY . .
  14. COPY --from=builder /build/build ./web/build
  15. RUN go mod download
  16. RUN go build -ldflags "-s -w -X 'message-pusher/common.Version=$(cat VERSION)' -extldflags '-static'" -o message-pusher
  17. FROM alpine
  18. ENV PORT=3000
  19. COPY --from=builder2 /build/message-pusher /
  20. EXPOSE 3000
  21. WORKDIR /data
  22. ENTRYPOINT ["/message-pusher"]