FROM alpine:3.24.2@sha256:294b683cb724975bec92580e1e685676bd4b50bda910ddb8c51d4cabeaec77e6 SHELL ["/bin/ash", "-euo", "pipefail", "-c"] HEALTHCHECK CMD ["/usr/bin/curl", "-fsSL", "--socks5", "localhost:9050", "--socks5-hostname", "localhost:9050", "https://check.torproject.org/api/ip"] RUN apk upgrade --no-cache \ && apk add --no-cache \ bash=5.3.9-r1 \ curl=8.22.0-r0 \ gettext=1.0-r0 \ git=2.54.0-r0 \ tor=0.4.9.13-r0 \ && apk cache --no-cache clean \ && rm -rf /var/cache/apk/* RUN chmod ugo+rwx /etc/tor COPY torrc.template tor-wrapper.sh /etc/tor/ RUN chmod ugo+rx /etc/tor/tor-wrapper.sh USER "tor" WORKDIR "/var/lib/tor" EXPOSE 9050 ENTRYPOINT ["/etc/tor/tor-wrapper.sh"] CMD []