lbry-sdk/lbry/scripts/Dockerfile.wallet_server

57 lines
1.4 KiB
Text
Raw Normal View History

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
RUN apt-get update && apt-get -y --no-install-recommends install build-essential git python3.7 python3.7-dev python3-pip && rm -rf /var/lib/apt/lists/*
# 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
# get uvloop
RUN python3.7 -m pip install --user uvloop
2018-12-28 21:19:11 +01:00
# copy lbrynet
2019-06-21 00:21:48 +02:00
ARG projects_dir=/home/$user/projects
RUN mkdir $projects_dir
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-06-20 23:51:56 +02:00
RUN python3.7 -m pip install --user .
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
ENV EVENT_LOOP_POLICY=uvloop
2018-12-28 21:19:11 +01:00
ENTRYPOINT ["/home/lbry/.local/bin/torba-server"]