HaProxyTor / Dockerfile
MB-IDK's picture
Update Dockerfile
efc2d9c verified
FROM debian:bullseye-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
tor \
haproxy \
privoxy \
procps \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /tmp/tor && chown -R 1000:1000 /tmp/tor && chmod -R 777 /tmp/tor
# Configuration de Privoxy (Port 7860 vers HAProxy 8888)
RUN echo "listen-address 0.0.0.0:7860\ntoggle 1\nenable-remote-toggle 0\nenable-remote-http-toggle 0\nenable-edit-actions 0\nenforce-blocks 0\nbuffer-limit 4096\nforward-socks5t / 127.0.0.1:8888 ." > /etc/privoxy/config
# On utilise ton fichier haproxy.cfg externe
COPY haproxy.cfg /etc/haproxy/haproxy.cfg
# Script d'entrée pour lancer les 10 instances Tor (9050-9059)
RUN echo '#!/bin/bash\n\
for i in {0..9};\n\
do\n\
port=$((9050 + i))\n\
mkdir -p /tmp/tor/$i\n\
tor --SocksPort $port --DataDirectory /tmp/tor/$i --RunAsDaemon 1\n\
done\n\
haproxy -f /etc/haproxy/haproxy.cfg -D\n\
privoxy --no-daemon /etc/privoxy/config' > /entrypoint.sh && chmod +x /entrypoint.sh
USER 1000
EXPOSE 7860 7861
CMD ["/entrypoint.sh"]