Dockerfile-build 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. FROM golang:1.21-bullseye as builder
  2. ARG VERSION=dev
  3. ARG COMMIT=unknown
  4. ARG NODE_MAJOR=18
  5. RUN apt-get update && apt-get install -y \
  6. build-essential ca-certificates curl gnupg \
  7. && mkdir -p /etc/apt/keyrings \
  8. && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
  9. && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" >> /etc/apt/sources.list.d/nodesource.list \
  10. && apt-get update \
  11. && apt-get install -y \
  12. python3-pip \
  13. python3-venv \
  14. nodejs \
  15. && rm -rf /var/lib/apt/lists/*
  16. WORKDIR /app
  17. ADD Makefile .
  18. # docs
  19. ADD ./requirements.txt .
  20. RUN make docs-deps
  21. ADD ./mkdocs.yml .
  22. ADD ./docs ./docs
  23. RUN make docs-build
  24. # web
  25. ADD ./web/package.json ./web/package-lock.json ./web/
  26. RUN make web-deps
  27. ADD ./web ./web
  28. RUN make web-build
  29. # cli & server
  30. ADD go.mod go.sum main.go ./
  31. ADD ./client ./client
  32. ADD ./cmd ./cmd
  33. ADD ./log ./log
  34. ADD ./server ./server
  35. ADD ./user ./user
  36. ADD ./util ./util
  37. RUN make VERSION=$VERSION COMMIT=$COMMIT cli-linux-server
  38. FROM alpine
  39. LABEL org.opencontainers.image.authors="philipp.heckel@gmail.com"
  40. LABEL org.opencontainers.image.url="https://ntfy.sh/"
  41. LABEL org.opencontainers.image.documentation="https://docs.ntfy.sh/"
  42. LABEL org.opencontainers.image.source="https://github.com/binwiederhier/ntfy"
  43. LABEL org.opencontainers.image.vendor="Philipp C. Heckel"
  44. LABEL org.opencontainers.image.licenses="Apache-2.0, GPL-2.0"
  45. LABEL org.opencontainers.image.title="ntfy"
  46. LABEL org.opencontainers.image.description="Send push notifications to your phone or desktop using PUT/POST"
  47. COPY --from=builder /app/dist/ntfy_linux_server/ntfy /usr/bin/ntfy
  48. EXPOSE 80/tcp
  49. ENTRYPOINT ["ntfy"]