From 64c6ba6857920e6c6fd7821eaa03789cd9785f13 Mon Sep 17 00:00:00 2001 From: Leopere Date: Thu, 31 May 2018 20:09:31 -0400 Subject: [PATCH] Migrated dockerfile from a different PR I submitted. --- lbrynet-daemon/Dockerfile | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 lbrynet-daemon/Dockerfile diff --git a/lbrynet-daemon/Dockerfile b/lbrynet-daemon/Dockerfile new file mode 100644 index 0000000..b70f614 --- /dev/null +++ b/lbrynet-daemon/Dockerfile @@ -0,0 +1,56 @@ +## Base Image +FROM ubuntu:18.04 +MAINTAINER chamunks [at] gmail [dot] com + +RUN apt-get update && apt-get -y install unzip +# RUN mkdir -pv /app && chown 1000:1000 /app +RUN adduser lbrynet --gecos GECOS --shell /bin/bash/ --disabled-password --home /data/ + +## Add lbrynet +ADD https://lbry.io/get/lbrynet.linux.zip /data/lbrynet.linux.zip +RUN unzip /data/lbrynet.linux.zip -d /data/ && \ + rm /data/lbrynet.linux.zip && \ + chown -Rv lbrynet:lbrynet /app + +## Install into PATH +RUN mv /data/lbrynet-* /bin/ && \ + ls -lAh /bin/ + +## Daemon port [Intended for internal use] +EXPOSE 4444 +## Peer port +## Intended for external use, in other words publishing to host might be required. +EXPOSE 3333 +## Wallet port [Intended for internal use] +EXPOSE 50001 + +## Undocumented ports that exist in conf.py +## API port +# EXPOSE 5279 +# ## Reflector port +# EXPOSE 5566 + +## VOLUMES +## Right now the volumes are just added in a commented out state but if the end +## user would prefer to add volumes to their own usage cases all they will need +## to do is uncomment what they require and then build the container using docker-compose.yml + +## Volumize the wallets in a separate location for backup purposes may be unnecessary. +# VOLUME /data/.local/share/lbry/lbryum/wallets +# VOLUME /data/.local/ +## If the config ends up needing it's own volume it should be located here. +# VOLUME /etc/lbry/conf.py +## Downloaded blobs will be in their own separate volume for keeping backups of critical secrets and data separate from backups of potentially massive blob files. +# VOLUME /data/Downloads/ + +## Never run container processes as root +USER lbrynet +## Run on container launch +CMD ["lbrynet-daemon"] + +## Setting this entrypoint should mean that you can `docker exec lbrynet commands` +## and you should be able to control the daemon's CLI this way. There is an +## alternative method we could use here where we have an entrypoint shell script which could be a bit smarter. +## An docker-entrypoint should eventually be created and installed into the container $PATH with a config install script that checks for the existance of a config.py and if it exists don't install docker envvars established elsewhere. +## If the container doesn't detect a conf.py file however have it install a fresh copy into /etc/lbry/conf.py and run that from a fresh copy from somewhere sensible. +# ENTRYPOINT ["lbrynet-cli"]