diff options
Diffstat (limited to 'other/bootstrap_daemon/docker/Dockerfile')
-rw-r--r-- | other/bootstrap_daemon/docker/Dockerfile | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/other/bootstrap_daemon/docker/Dockerfile b/other/bootstrap_daemon/docker/Dockerfile new file mode 100644 index 00000000..ef9d525c --- /dev/null +++ b/other/bootstrap_daemon/docker/Dockerfile | |||
@@ -0,0 +1,59 @@ | |||
1 | FROM debian:jessie | ||
2 | |||
3 | # get all deps | ||
4 | RUN apt-get update && apt-get install -y \ | ||
5 | build-essential \ | ||
6 | libtool \ | ||
7 | autotools-dev \ | ||
8 | automake \ | ||
9 | checkinstall \ | ||
10 | check \ | ||
11 | git \ | ||
12 | yasm \ | ||
13 | libsodium-dev \ | ||
14 | libconfig-dev \ | ||
15 | python3 \ | ||
16 | && apt-get clean \ | ||
17 | && rm -rf /var/lib/apt/lists/* | ||
18 | |||
19 | # install toxcore and daemon | ||
20 | WORKDIR /root/ | ||
21 | RUN git clone https://github.com/irungentoo/toxcore | ||
22 | WORKDIR /root/toxcore/ | ||
23 | RUN ./autogen.sh | ||
24 | RUN ./configure --enable-daemon | ||
25 | RUN make -j`nproc` | ||
26 | RUN make install -j`nproc` | ||
27 | RUN ldconfig | ||
28 | |||
29 | WORKDIR /root/toxcore/other/bootstrap_daemon/ | ||
30 | |||
31 | # add new user | ||
32 | RUN useradd --home-dir /var/lib/tox-bootstrapd --create-home \ | ||
33 | --system --shell /sbin/nologin \ | ||
34 | --comment "Account to run Tox's DHT bootstrap daemon" \ | ||
35 | --user-group tox-bootstrapd | ||
36 | RUN chmod 700 /var/lib/tox-bootstrapd | ||
37 | |||
38 | RUN cp tox-bootstrapd.conf /etc/tox-bootstrapd.conf | ||
39 | |||
40 | # remove all the example bootstrap nodes from the config file | ||
41 | RUN N=-1 && \ | ||
42 | while grep -q "bootstrap_nodes =" /etc/tox-bootstrapd.conf; \ | ||
43 | do \ | ||
44 | head -n $N tox-bootstrapd.conf > /etc/tox-bootstrapd.conf; \ | ||
45 | N=$((N-1)); \ | ||
46 | done | ||
47 | |||
48 | # add bootstrap nodes from https://nodes.tox.chat/ | ||
49 | RUN python3 docker/get-nodes.py >> /etc/tox-bootstrapd.conf | ||
50 | |||
51 | USER tox-bootstrapd | ||
52 | |||
53 | ENTRYPOINT /usr/local/bin/tox-bootstrapd \ | ||
54 | --config /etc/tox-bootstrapd.conf \ | ||
55 | --log-backend stdout \ | ||
56 | --foreground | ||
57 | |||
58 | EXPOSE 443 3389 33445 | ||
59 | EXPOSE 33445/udp | ||