zeronet/Dockerfile

42 lines
1.2 KiB
Docker
Raw Permalink Normal View History

2016-03-19 13:16:39 +00:00
# docker build -t my/zeronet .
2016-03-19 13:18:24 +00:00
# docker run -d --name zeronet -v ~/.zeronetdata:/data -p 43110:43110 my/zeronet
2016-03-19 13:16:39 +00:00
2018-03-03 23:29:48 +00:00
FROM alpine:3.7
2016-03-19 10:27:52 +00:00
MAINTAINER Andrey Arapov <andrey.arapov@nixaid.com>
2018-03-03 23:29:48 +00:00
RUN apk update \
&& apk add py-gevent py-msgpack ca-certificates python
2016-03-19 10:27:52 +00:00
2017-06-20 18:32:27 +00:00
# Optionally you may want to enable Tor in order to anonymize the traffic
2018-03-03 23:29:48 +00:00
RUN apk add tor
2016-03-24 22:34:08 +00:00
RUN echo -e "ControlPort 9051\nSocksListenAddress 0.0.0.0" > /etc/tor/torrc
# RUN echo -e "ControlPort 9051" > /etc/tor/torrc
2016-03-23 20:27:37 +00:00
# RUN echo -e "ControlPort 9051\nCookieAuthentication 1" > /etc/tor/torrc
# RUN adduser $USER tor
2018-03-03 23:29:48 +00:00
ENV USER=zeronet \
UID=1000 \
HOME=/home/zeronet \
PROJECT_VER=v0.6.2 \
PROJECT=ZeroNet-0.6.2 \
DATA=/data
RUN adduser -D -u $UID -h $HOME -s /bin/true $USER
2016-03-19 10:27:52 +00:00
USER $USER
2018-03-03 23:29:48 +00:00
VOLUME ["$DATA"]
2016-03-19 10:27:52 +00:00
WORKDIR $HOME
2018-03-03 23:29:48 +00:00
RUN wget -O data.tar.gz -q https://github.com/HelloZeroNet/ZeroNet/archive/${PROJECT_VER}.tar.gz \
&& tar xpzf data.tar.gz \
&& rm -f data.tar.gz \
2016-03-19 13:16:39 +00:00
&& cd $PROJECT \
2016-03-19 10:27:52 +00:00
&& mkdir log \
2016-03-19 13:16:39 +00:00
&& touch log/error.log \
&& ln -sv $DATA ./data
2016-03-19 10:27:52 +00:00
2016-03-19 13:16:39 +00:00
# the launch script needs to chown the /data in case when $UID does not match
# the UID of the host
USER root
COPY launch ./$PROJECT/
CMD ./$PROJECT/launch