<gh_stars>10-100
FROM alpine

RUN apk --no-cache --no-progress upgrade && \
    apk --no-cache --no-progress add privoxy shadow tor tzdata&&\
    mkdir -p /etc/tor/run && \
    chown -Rh tor. /var/lib/tor /etc/tor/run && \
    chmod 0750 /etc/tor/run && \
    rm -rf /tmp/*

COPY torrc /etc/tor/torrc
COPY privoxy-config /etc/privoxy/config
COPY tor.sh /usr/local/bin/

RUN chown -Rh tor. /etc/tor /var/lib/tor /var/log/tor
RUN chown privoxy.privoxy /etc/privoxy/*
RUN chmod +x /usr/local/bin/tor.sh

EXPOSE 5353 8118 9040 9050

VOLUME ["/etc/tor", "/var/lib/tor"]

ENTRYPOINT ["tor.sh"]
