Dockerfile 798 B

12345678910111213141516171819202122232425262728
  1. FROM docker.io/alpine:3.19.1
  2. # https://git.alpinelinux.org/aports/log/community/postsrsd?h=3.19-stable
  3. ARG POSTSRSD_PACKAGE_VERSION=2.0.8-r0
  4. RUN adduser -S postsrsd \
  5. && apk add --no-cache postsrsd=$POSTSRSD_PACKAGE_VERSION \
  6. && mkdir -p /etc/postsrsd/secrets \
  7. && chown postsrsd /etc/postsrsd/secrets
  8. USER postsrsd
  9. VOLUME /etc/postsrsd/secrets
  10. # https://github.com/roehling/postsrsd/blob/1.6/postsrsd.c#L342
  11. ENV SRS_DOMAIN change-me.tld
  12. ENV SRS_SECRET /etc/postsrsd/secrets/list
  13. # forward SRS lookup
  14. EXPOSE 10001/tcp
  15. # reverse SRS lookup
  16. EXPOSE 10002/tcp
  17. # > Cannot open file with secret: /etc/postsrsd/secrets/list
  18. CMD set -x; \
  19. if [ ! -f "$SRS_SECRET" ]; \
  20. then tr -dc '1-9a-zA-Z' < /dev/random | head -c 32 > "$SRS_SECRET"; \
  21. fi \
  22. && postsrsd -l0.0.0.0 -e