2018-12-28 21:19:11 +01:00
|
|
|
FROM debian:buster-slim
|
|
|
|
|
|
|
|
ARG user=lbry
|
|
|
|
|
|
|
|
# create an unprivileged user
|
|
|
|
RUN groupadd -g 999 $user && useradd -r -u 999 -g $user $user
|
|
|
|
RUN mkdir -p /home/$user/
|
|
|
|
RUN chown -R $user:$user /home/$user/
|
|
|
|
|
|
|
|
# install python, pip, git and clean up
|
2019-11-21 20:16:10 +01:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get -y --no-install-recommends install build-essential git tar wget python3.7 python3.7-dev python3-pip && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2018-12-28 21:19:11 +01:00
|
|
|
|
|
|
|
# create and chown database dir
|
|
|
|
ARG db_dir=/database
|
|
|
|
RUN mkdir -p $db_dir
|
|
|
|
RUN chown -R $user:$user $db_dir
|
|
|
|
|
|
|
|
# change into our user
|
|
|
|
USER $user
|
|
|
|
WORKDIR /home/$user
|
|
|
|
|
|
|
|
# RUN pip3 install -U pip (broken on pip 10 https://github.com/pypa/pip/issues/5240)
|
|
|
|
RUN python3.7 -m pip install --upgrade pip setuptools
|
|
|
|
|
2019-04-25 22:05:30 +02:00
|
|
|
# get uvloop
|
|
|
|
RUN python3.7 -m pip install --user uvloop
|
|
|
|
|
2018-12-28 21:19:11 +01:00
|
|
|
# copy lbrynet
|
2019-11-21 20:16:10 +01:00
|
|
|
ARG projects_dir=/home/$user
|
2019-06-21 00:21:48 +02:00
|
|
|
COPY . $projects_dir
|
2018-12-28 21:19:11 +01:00
|
|
|
USER root
|
|
|
|
RUN chown -R $user:$user .
|
|
|
|
USER $user
|
2019-06-21 00:21:48 +02:00
|
|
|
|
|
|
|
# install torba & lbry
|
|
|
|
WORKDIR $projects_dir/torba
|
2019-11-21 20:16:10 +01:00
|
|
|
RUN python3.7 -m pip install --user -e .
|
2019-06-21 00:21:48 +02:00
|
|
|
WORKDIR $projects_dir/lbry
|
|
|
|
RUN python3.7 -m pip install --user -e .
|
|
|
|
RUN rm ~/.cache -rf
|
2018-12-28 21:19:11 +01:00
|
|
|
|
|
|
|
# entry point
|
|
|
|
ARG host=0.0.0.0
|
|
|
|
ARG tcp_port=50001
|
|
|
|
ARG daemon_url=http://lbry:lbry@localhost:9245/
|
|
|
|
VOLUME $db_dir
|
|
|
|
ENV TCP_PORT=$tcp_port
|
|
|
|
ENV HOST=$host
|
|
|
|
ENV DAEMON_URL=$daemon_url
|
|
|
|
ENV DB_DIRECTORY=$db_dir
|
|
|
|
ENV BANDWIDTH_LIMIT=1000000000000000000000000000000000000000000
|
|
|
|
ENV MAX_SESSIONS=1000000000
|
|
|
|
ENV MAX_SEND=1000000000000000000
|
2019-04-25 22:05:30 +02:00
|
|
|
ENV EVENT_LOOP_POLICY=uvloop
|
2019-11-21 20:16:10 +01:00
|
|
|
COPY ./docker/wallet_server_entrypoint.sh /entrypoint.sh
|
2019-09-16 15:51:22 +02:00
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|