Dockerfile 768 B

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