Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +43 -34
Dockerfile
CHANGED
|
@@ -1,41 +1,50 @@
|
|
| 1 |
FROM debian:bullseye-slim
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
timeout
|
| 26 |
-
timeout
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
server
|
| 34 |
-
server
|
| 35 |
-
server
|
|
|
|
| 36 |
server t4 127.0.0.1:9054 check" > /etc/haproxy/haproxy.cfg
|
| 37 |
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
USER 1000
|
| 40 |
EXPOSE 7860
|
| 41 |
|
|
|
|
| 1 |
FROM debian:bullseye-slim
|
| 2 |
|
| 3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 4 |
+
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
tor \
|
| 7 |
+
haproxy \
|
| 8 |
+
privoxy \
|
| 9 |
+
procps \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
RUN mkdir -p /tmp/tor && chown -R 1000:1000 /tmp/tor && chmod -R 777 /tmp/tor
|
| 13 |
+
|
| 14 |
+
RUN echo "listen-address 0.0.0.0:7860\n\
|
| 15 |
+
toggle 1\n\
|
| 16 |
+
enable-remote-toggle 0\n\
|
| 17 |
+
enable-remote-http-toggle 0\n\
|
| 18 |
+
enable-edit-actions 0\n\
|
| 19 |
+
enforce-blocks 0\n\
|
| 20 |
+
buffer-limit 4096\n\
|
| 21 |
+
forward-socks5t / 127.0.0.1:8888 ." > /etc/privoxy/config
|
| 22 |
+
|
| 23 |
+
RUN echo "defaults\n\
|
| 24 |
+
mode tcp\n\
|
| 25 |
+
timeout connect 10s\n\
|
| 26 |
+
timeout client 1m\n\
|
| 27 |
+
timeout server 1m\n\
|
| 28 |
+
frontend tor_front\n\
|
| 29 |
+
bind *:8888\n\
|
| 30 |
+
default_backend tor_back\n\
|
| 31 |
+
backend tor_back\n\
|
| 32 |
+
balance roundrobin\n\
|
| 33 |
+
server t0 127.0.0.1:9050 check\n\
|
| 34 |
+
server t1 127.0.0.1:9051 check\n\
|
| 35 |
+
server t2 127.0.0.1:9052 check\n\
|
| 36 |
+
server t3 127.0.0.1:9053 check\n\
|
| 37 |
server t4 127.0.0.1:9054 check" > /etc/haproxy/haproxy.cfg
|
| 38 |
|
| 39 |
+
RUN echo '#!/bin/bash\n\
|
| 40 |
+
for i in {0..4}; do\n\
|
| 41 |
+
port=$((9050 + i))\n\
|
| 42 |
+
mkdir -p /tmp/tor/$i\n\
|
| 43 |
+
tor --SocksPort $port --DataDirectory /tmp/tor/$i --RunAsDaemon 1\n\
|
| 44 |
+
done\n\
|
| 45 |
+
haproxy -f /etc/haproxy/haproxy.cfg -D\n\
|
| 46 |
+
privoxy --no-daemon /etc/privoxy/config' > /entrypoint.sh && chmod +x /entrypoint.sh
|
| 47 |
+
|
| 48 |
USER 1000
|
| 49 |
EXPOSE 7860
|
| 50 |
|