PyBitmessage-2021-04-27/Dockerfile

44 lines
976 B
Docker
Raw Permalink Normal View History

2018-06-21 11:58:25 +02:00
# A container for PyBitmessage daemon
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
2020-10-15 15:22:03 +02:00
RUN pip2 install --upgrade pip
2018-06-21 11:58:25 +02:00
EXPOSE 8444 8442
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
# Create a user
RUN useradd bitmessage && chown -R bitmessage ${HOME}
USER bitmessage
# Clean HOME
RUN rm -rf ${HOME}/*
2020-10-15 15:22:03 +02:00
# Generate default config
RUN pybitmessage -t
# Setup environment
2020-10-15 15:22:03 +02:00
RUN APIPASS=$(tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo) \
&& 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"]