2018-06-21 11:58:25 +02:00
|
|
|
# A container for PyBitmessage daemon
|
|
|
|
|
2018-07-16 10:55:55 +02:00
|
|
|
FROM ubuntu:xenial
|
|
|
|
|
|
|
|
RUN apt-get update
|
|
|
|
|
|
|
|
# Install dependencies
|
|
|
|
RUN apt-get install -yq --no-install-suggests --no-install-recommends \
|
2020-10-15 15:22:03 +02:00
|
|
|
build-essential libcap-dev libssl-dev \
|
|
|
|
python-all-dev python-msgpack python-pip python-setuptools
|
2018-07-16 10:55:55 +02:00
|
|
|
|
2020-10-15 15:22:03 +02:00
|
|
|
RUN pip2 install --upgrade pip
|
2018-07-16 10:55:55 +02:00
|
|
|
|
2018-06-21 11:58:25 +02:00
|
|
|
EXPOSE 8444 8442
|
2018-07-16 10:55:55 +02:00
|
|
|
|
|
|
|
ENV HOME /home/bitmessage
|
|
|
|
ENV BITMESSAGE_HOME ${HOME}
|
|
|
|
|
|
|
|
WORKDIR ${HOME}
|
|
|
|
ADD . ${HOME}
|
|
|
|
|
|
|
|
# Install tests dependencies
|
2020-10-15 15:22:03 +02:00
|
|
|
RUN pip2 install -r requirements.txt
|
|
|
|
# Install
|
|
|
|
RUN python2 setup.py install
|
2018-07-16 10:55:55 +02:00
|
|
|
|
2019-02-06 16:19:09 +01:00
|
|
|
# Create a user
|
|
|
|
RUN useradd bitmessage && chown -R bitmessage ${HOME}
|
|
|
|
|
|
|
|
USER bitmessage
|
|
|
|
|
2018-07-16 10:55:55 +02:00
|
|
|
# Clean HOME
|
2019-02-06 16:19:09 +01:00
|
|
|
RUN rm -rf ${HOME}/*
|
2018-07-16 10:55:55 +02:00
|
|
|
|
2020-10-15 15:22:03 +02:00
|
|
|
# Generate default config
|
|
|
|
RUN pybitmessage -t
|
|
|
|
|
2018-07-16 10:55:55 +02:00
|
|
|
# Setup environment
|
2020-10-15 15:22:03 +02:00
|
|
|
RUN APIPASS=$(tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo) \
|
2018-07-16 10:55:55 +02:00
|
|
|
&& echo "\napiusername: api\napipassword: $APIPASS" \
|
|
|
|
&& echo "apienabled = true\napiinterface = 0.0.0.0\napiusername = api\napipassword = $APIPASS" >> keys.dat
|
|
|
|
|
2018-06-21 11:58:25 +02:00
|
|
|
CMD ["pybitmessage", "-d"]
|