Dockerfile 655 B

12345678910111213141516171819202122232425
  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. && adduser -S onion \
  8. && mkdir -m u=rwx,g=,o= /onion-service \
  9. && chown onion /onion-service
  10. VOLUME /onion-service
  11. COPY torrc.template entrypoint.sh /
  12. RUN chmod -c a+rX /torrc.template /entrypoint.sh
  13. ENV VERSION 3
  14. ENV VIRTUAL_PORT 80
  15. ENV TARGET 1.2.3.4:8080
  16. ENTRYPOINT ["/entrypoint.sh"]
  17. USER onion
  18. CMD ["tor", "-f", "/tmp/torrc"]
  19. HEALTHCHECK CMD \
  20. nc -x localhost:9050 -z "$(cat /onion-service/hostname)" "$VIRTUAL_PORT" \
  21. || exit 1