File size: 1,060 Bytes
efc2d9c
1217469
efc2d9c
74609ea
 
 
 
 
 
efc2d9c
1217469
efc2d9c
ef9a2be
efc2d9c
 
ef9a2be
efc2d9c
ef9a2be
 
efc2d9c
74609ea
ef9a2be
 
74609ea
 
 
 
 
efc2d9c
74609ea
2fb3101
efc2d9c
1217469
ef9a2be
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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"]