Update Dockerfile

This commit is contained in:
Jon P 2017-07-17 16:08:18 +02:00
parent 8281176873
commit 6e51b5ba32
1 changed files with 13 additions and 17 deletions

View File

@ -1,32 +1,28 @@
FROM ubuntu:16.04
MAINTAINER Felix Imobersteg <felix@whatwedo.ch>
FROM alpine:3.6
#Base settings
ENV DEBIAN_FRONTEND noninteractive
ENV HOME /root
#Install ZeroNet
RUN \
apt-get update -y; \
apt-get -y install msgpack-python python-gevent python-pip python-dev tor; \
pip install msgpack-python --upgrade; \
apt-get clean -y; \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
echo "ControlPort 9051" >> /etc/tor/torrc; \
echo "CookieAuthentication 1" >> /etc/tor/torrc
RUN apk --update upgrade \
&& apk --no-cache --no-progress add musl-dev gcc python python-dev py2-pip tor \
&& pip install gevent msgpack-python \
&& apk del musl-dev gcc python-dev py2-pip \
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/* \
&& echo "ControlPort 9051" >> /etc/tor/torrc \
&& echo "CookieAuthentication 1" >> /etc/tor/torrc
#Add Zeronet source
ADD . /root
COPY . /root
VOLUME /root/data
#Control if Tor proxy is started
ENV ENABLE_TOR false
WORKDIR /root
#Set upstart command
CMD cd /root && (! ${ENABLE_TOR} || /etc/init.d/tor start) && python zeronet.py --ui_ip 0.0.0.0
CMD (! ${ENABLE_TOR} || tor&) && python zeronet.py --ui_ip 0.0.0.0
#Expose ports
EXPOSE 43110
EXPOSE 15441
EXPOSE 43110 15441