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

44 lines
1.0 KiB
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
2022-03-23 17:24:29 +01:00
RUN pip2 install jsonrpclib .
# 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" \
2022-03-23 17:24:29 +01:00
&& sed -ie "s|\(apiinterface = \).*|\10\.0\.0\.0|g" keys.dat \
&& sed -ie "s|\(apivariant = \).*|\1json|g" keys.dat \
&& sed -ie "s|\(apiusername = \).*|\1api|g" keys.dat \
&& sed -ie "s|\(apipassword = \).*|\1$APIPASS|g" keys.dat
2018-06-21 11:58:25 +02:00
CMD ["pybitmessage", "-d"]