MB-IDK commited on
Commit
f0bd747
·
verified ·
1 Parent(s): 159cc2e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -21
Dockerfile CHANGED
@@ -1,11 +1,12 @@
1
- FROM debian:stable-slim
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV TOR_SOCKS_PORT=9050
5
  ENV PRIVOXY_PORT=7860
6
 
7
- # Install deps
8
- RUN apt-get update && apt-get install -y \
 
9
  tor \
10
  privoxy \
11
  curl \
@@ -14,7 +15,8 @@ RUN apt-get update && apt-get install -y \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
  # ---- Tor config ----
17
- RUN printf "SocksPort %s\nRunAsDaemon 0\nDataDirectory /var/lib/tor\n" "$TOR_SOCKS_PORT" > /etc/tor/torrc
 
18
 
19
  # ---- Privoxy config ----
20
  RUN printf "user-manual /usr/share/doc/privoxy/user-manual\n\
@@ -37,23 +39,16 @@ RUN curl -fsSL https://github.com/ekzhang/bore/releases/latest/download/bore-lin
37
  rm /tmp/bore.zip
38
 
39
  # ---- Startup script ----
40
- RUN cat << 'EOF' > /start.sh
41
- #!/bin/bash
42
- set -e
43
-
44
- echo "[+] Starting Tor"
45
- tor &
46
- sleep 6
47
-
48
- echo "[+] Starting Privoxy on port 7860"
49
- privoxy --no-daemon /etc/privoxy/config &
50
- sleep 4
51
-
52
- echo "[+] Publishing proxy via bore.pub"
53
- exec bore pub 7860 --to bore.pub
54
- EOF
55
-
56
- RUN chmod +x /start.sh
57
 
58
  EXPOSE 7860
59
  CMD ["/start.sh"]
 
1
+ FROM ubuntu:22.04
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV TOR_SOCKS_PORT=9050
5
  ENV PRIVOXY_PORT=7860
6
 
7
+ # ---- Fix apt HF ----
8
+ RUN apt-get update && \
9
+ apt-get install -y --no-install-recommends \
10
  tor \
11
  privoxy \
12
  curl \
 
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
  # ---- Tor config ----
18
+ RUN printf "SocksPort %s\nRunAsDaemon 0\nDataDirectory /var/lib/tor\n" \
19
+ "$TOR_SOCKS_PORT" > /etc/tor/torrc
20
 
21
  # ---- Privoxy config ----
22
  RUN printf "user-manual /usr/share/doc/privoxy/user-manual\n\
 
39
  rm /tmp/bore.zip
40
 
41
  # ---- Startup script ----
42
+ RUN printf '#!/bin/bash\n\
43
+ set -e\n\
44
+ echo "[+] Tor starting"\n\
45
+ tor &\n\
46
+ sleep 8\n\
47
+ echo "[+] Privoxy starting"\n\
48
+ privoxy --no-daemon /etc/privoxy/config &\n\
49
+ sleep 4\n\
50
+ echo "[+] Exposing via bore.pub"\n\
51
+ exec bore pub 7860 --to bore.pub\n' > /start.sh && chmod +x /start.sh
 
 
 
 
 
 
 
52
 
53
  EXPOSE 7860
54
  CMD ["/start.sh"]