1
0

Dockerfile 861 B

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