Dockerfile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. FROM docker.io/alpine:3.15.4
  2. ARG DUMB_INIT_PACKAGE_VERSION=1.2.5-r1
  3. ARG NETCAT_PACKAGE_VERSION=1.130-r3
  4. ARG DMA_REPOSITORY=http://dl-cdn.alpinelinux.org/alpine/edge/testing
  5. ARG DMA_PACKAGE_VERSION=0.13-r2
  6. RUN apk add --no-cache \
  7. dumb-init=${DUMB_INIT_PACKAGE_VERSION} \
  8. netcat-openbsd=${NETCAT_PACKAGE_VERSION} \
  9. && apk add --repository=${DMA_REPOSITORY} --no-cache \
  10. dma=${DMA_PACKAGE_VERSION} \
  11. && adduser -S -G mail report
  12. VOLUME /var/spool/dma
  13. ENV TOR_HOST= \
  14. TOR_PORT=9050 \
  15. ONION_SERVICE_HOST= \
  16. ONION_SERVICE_PORT= \
  17. TIMEOUT_SECONDS=4 \
  18. SLEEP_DURATION=16s \
  19. RETRIES=0 \
  20. MAIL_TO= \
  21. VERBOSE=
  22. COPY --chown=report:nobody monitor.sh /
  23. USER report
  24. ENTRYPOINT ["dumb-init", "--"]
  25. CMD ["/monitor.sh"]
  26. HEALTHCHECK CMD nc -z "$TOR_HOST" "$TOR_PORT" || exit 1
  27. # https://github.com/opencontainers/image-spec/blob/v1.0.1/annotations.md
  28. ARG REVISION=
  29. LABEL org.opencontainers.image.title="report online status of tor onion services via email" \
  30. org.opencontainers.image.source="https://github.com/fphammerle/onion-service-status-mail" \
  31. org.opencontainers.image.revision="$REVISION"