lbry-sdk/scripts/Dockerfile.wallet_server

55 lines
1.5 KiB
Text
Raw Normal View History

2018-12-28 21:19:11 +01:00
FROM debian:buster-slim
ARG user=lbry
2019-06-05 23:35:26 +02:00
ARG TORBA_VERSION=master
2018-12-28 21:19:11 +01:00
# 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 torba
2019-06-05 23:35:26 +02:00
RUN python3.7 -m pip install --user git+https://github.com/lbryio/torba.git@${TORBA_VERSION}#egg=torba
2018-12-28 21:19:11 +01:00
# get uvloop
RUN python3.7 -m pip install --user uvloop
2018-12-28 21:19:11 +01:00
# copy lbrynet
RUN mkdir projects/
COPY . projects/lbry
USER root
RUN chown -R $user:$user .
USER $user
WORKDIR projects/lbry
RUN python3.7 -m pip install --user -e . && rm ~/.cache -rf
# 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"]