File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM ubuntu:20.04
2
+
3
+ # Timezone settings
4
+ ENV TZ=Etc/UTC
5
+ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
6
+
7
+ # Install dependencies
8
+ RUN apt update \
9
+ && apt install -y python3-pip tor openssl \
10
+ gcc libffi-dev musl-dev make \
11
+ pkg-config
12
+
13
+ # Setup Tor
14
+ RUN echo "ControlPort 9051" >> /etc/tor/torrc \
15
+ && echo "CookieAuthentication 1" >> /etc/tor/torrc
16
+
17
+ # Set up a non-root user
18
+ RUN useradd --uid 1000 --shell /bin/bash --create-home znuser
19
+ WORKDIR /home/znuser
20
+
21
+ # Add Zeronet source
22
+ COPY . .
23
+ VOLUME /home/znuser/data
24
+ RUN pip3 install -r requirements.txt && chown znuser:znuser -R data
25
+
26
+ USER znuser
27
+
28
+ # Show verbose info
29
+ RUN python3 -V \
30
+ && python3 -m pip list \
31
+ && tor --version \
32
+ && openssl version
33
+
34
+ # Control if Tor proxy is started
35
+ ENV ENABLE_TOR false
36
+
37
+ #Set upstart command
38
+ CMD (! ${ENABLE_TOR} || tor&) && python3 zeronet.py --ui_ip 0.0.0.0 --ui_host 127.0.0.1:43110 --fileserver_port 26552
39
+
40
+ # Expose ports
41
+ EXPOSE 43110 26552
You can’t perform that action at this time.
0 commit comments