Dockerfile 696 B

12345678910111213141516171819202122232425262728293031
  1. FROM node:16 as builder
  2. WORKDIR /build
  3. COPY ./web .
  4. COPY ./VERSION .
  5. RUN yarn install
  6. RUN REACT_APP_VERSION=$(cat VERSION) yarn build
  7. FROM golang AS builder2
  8. ENV GO111MODULE=on \
  9. CGO_ENABLED=1 \
  10. GOOS=linux
  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 -X 'message-pusher/common.Version=$(cat VERSION)' -extldflags '-static'" -o message-pusher
  16. FROM alpine
  17. ENV PORT=3000
  18. RUN apk update \
  19. && apk upgrade \
  20. && apk add --no-cache ca-certificates tzdata \
  21. && update-ca-certificates 2>/dev/null || true
  22. COPY --from=builder2 /build/message-pusher /
  23. EXPOSE 3000
  24. WORKDIR /data
  25. ENTRYPOINT ["/message-pusher"]