This repository has been archived on 2024-12-12. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2024-12-12/Dockerfile

41 lines
898 B
Docker
Raw Normal View History

2018-06-21 11:58:25 +02:00
# A container for PyBitmessage daemon
FROM ubuntu:bionic
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-06-21 11:58:25 +02:00
EXPOSE 8444 8442
ENV HOME /home/bitmessage
ENV BITMESSAGE_HOME ${HOME}
WORKDIR ${HOME}
ADD . ${HOME}
2020-10-15 15:22:03 +02:00
# Install
RUN pip2 install .
# Cleanup
RUN rm -rf /var/lib/apt/lists/*
RUN rm -rf ${HOME}
# Create a user
RUN useradd -r bitmessage && chown -R bitmessage ${HOME}
USER bitmessage
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"]