Dockerfile 713 B

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