Dockerfile 897 B

123456789101112131415161718192021222324252627282930313233
  1. FROM alpine:3.13.1
  2. ARG GETTEXT_PACKAGE_VERSION=0.20.2-r2
  3. ARG TOR_PACKAGE_VERSION=0.4.4.6-r1
  4. RUN apk add --no-cache \
  5. tor=$TOR_PACKAGE_VERSION \
  6. gettext=$GETTEXT_PACKAGE_VERSION \
  7. && mkdir -m u=rwx,g=,o= /onion-service \
  8. && chown tor /onion-service
  9. VOLUME /var/lib/tor
  10. VOLUME /onion-service
  11. #RUN apk add --no-cache \
  12. # less \
  13. # man-db \
  14. # tor-doc=$TOR_PACKAGE_VERSION
  15. #ENV PAGER=less
  16. COPY torrc.template entrypoint.sh /
  17. RUN chmod -c a+rX /torrc.template /entrypoint.sh
  18. ENV VERSION 3
  19. ENV VIRTUAL_PORT 80
  20. ENV TARGET 1.2.3.4:8080
  21. ENV NON_ANONYMOUS_SINGLE_HOP_MODE 0
  22. ENTRYPOINT ["/entrypoint.sh"]
  23. USER tor
  24. CMD ["tor", "-f", "/tmp/torrc"]
  25. # https://gitweb.torproject.org/torspec.git/tree/control-spec.txt
  26. HEALTHCHECK CMD \
  27. printf "AUTHENTICATE\nGETINFO network-liveness\nQUIT\n" | nc localhost 9051 \
  28. | grep -q network-liveness=up || exit 1