Dockerfile-build 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. FROM golang:1.19-bullseye as builder
  2. ARG VERSION=dev
  3. ARG COMMIT=unknown
  4. RUN apt-get update
  5. RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash
  6. RUN apt-get install -y \
  7. build-essential \
  8. nodejs \
  9. python3-pip
  10. WORKDIR /app
  11. ADD Makefile .
  12. # docs
  13. ADD ./requirements.txt .
  14. RUN make docs-deps
  15. ADD ./mkdocs.yml .
  16. ADD ./docs ./docs
  17. RUN make docs-build
  18. # web
  19. ADD ./web/package.json ./web/package-lock.json ./web/
  20. RUN make web-deps
  21. ADD ./web ./web
  22. RUN make web-build
  23. # cli & server
  24. ADD go.mod go.sum main.go ./
  25. ADD ./client ./client
  26. ADD ./cmd ./cmd
  27. ADD ./log ./log
  28. ADD ./server ./server
  29. ADD ./user ./user
  30. ADD ./util ./util
  31. RUN make VERSION=$VERSION COMMIT=$COMMIT cli-linux-server
  32. FROM alpine
  33. LABEL org.opencontainers.image.authors="philipp.heckel@gmail.com"
  34. LABEL org.opencontainers.image.url="https://ntfy.sh/"
  35. LABEL org.opencontainers.image.documentation="https://docs.ntfy.sh/"
  36. LABEL org.opencontainers.image.source="https://github.com/binwiederhier/ntfy"
  37. LABEL org.opencontainers.image.vendor="Philipp C. Heckel"
  38. LABEL org.opencontainers.image.licenses="Apache-2.0, GPL-2.0"
  39. LABEL org.opencontainers.image.title="ntfy"
  40. LABEL org.opencontainers.image.description="Send push notifications to your phone or desktop using PUT/POST"
  41. COPY --from=builder /app/dist/ntfy_linux_server/ntfy /usr/bin/ntfy
  42. EXPOSE 80/tcp
  43. ENTRYPOINT ["ntfy"]