Dockerfile 447 B

123456789101112131415161718
  1. FROM alpine:edge
  2. RUN apk add --no-cache curl tor
  3. EXPOSE 9050
  4. HEALTHCHECK --interval=60s --timeout=15s --start-period=20s \
  5. CMD curl -x socks5h://127.0.0.1:9050 'https://check.torproject.org/api/ip' | grep -qm1 -E '"IsTor"\s*:\s*true'
  6. # default owner is tor, but running as root to avoid docker volume mount issue
  7. RUN chown -R root:root /var/lib/tor
  8. VOLUME ["/var/lib/tor/4get"]
  9. COPY ./torrc /etc/tor/torrc
  10. ENTRYPOINT ["/usr/bin/tor"]