Dockerfile 760 B

12345678910111213141516171819202122232425262728293031
  1. FROM alpine:3.12
  2. ARG NETCAT_PACKAGE_VERSION=1.130-r1
  3. ARG TOR_PACKAGE_VERSION=0.4.3.5-r0
  4. RUN apk add --no-cache \
  5. netcat-openbsd=$NETCAT_PACKAGE_VERSION \
  6. tor=$TOR_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. ENTRYPOINT ["/entrypoint.sh"]
  22. USER tor
  23. CMD ["tor", "-f", "/tmp/torrc"]
  24. HEALTHCHECK CMD \
  25. nc -x localhost:9050 -z "$(cat /onion-service/hostname)" "$VIRTUAL_PORT" \
  26. || exit 1