From c3accd79bdefe62884aebc3142d255485d7ac6fa Mon Sep 17 00:00:00 2001 From: Leopere Date: Thu, 25 Apr 2019 18:54:08 -0400 Subject: [PATCH] Adjusting to new structure Replaced build with image docker-compose.yml-prod-example Adjusted paths in volumes Removed a few more things healthcheck.sh which can be added later when completed. renamed the Dockerfile to Dockerfile-x86_64-production Updated image tag and added RUN_MODE Updated image and added RUN_MODE updated tag Updated tag --- README.md | 9 ++++-- ...ile => Dockerfile-linux-x86_64-production} | 0 .../compose/docker-compose.yml-prod-example | 11 +++---- chainquery/linux-x86_64-compile/.gitkeep | 1 - lbrycrd/compose/docker-compose.yml-regtest | 4 ++- lbrycrd/compose/docker-compose.yml-testnet | 13 ++------ ...ockerfile => Dockerfile-x86_64-production} | 32 ++++++------------- lbrynet/stuff/healthcheck.sh | 2 -- 8 files changed, 26 insertions(+), 46 deletions(-) rename chainquery/{linux-x86_64-production/Dockerfile => Dockerfile-linux-x86_64-production} (100%) delete mode 100644 chainquery/linux-x86_64-compile/.gitkeep rename lbrynet/{Dockerfile => Dockerfile-x86_64-production} (51%) delete mode 100755 lbrynet/stuff/healthcheck.sh diff --git a/README.md b/README.md index d1daaf3..0a6e882 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,10 @@ See [Running from source](##Running-from-source) for the current instructions on #### Currently supported platforms -**X64 cpu architecture** +**X86_64 cpu architecture** +Lbrynet, Lbrycrd, Chainqery are currently supported. + +**Some arm architectures** **More will be added on request and over time** @@ -50,7 +53,7 @@ Keep in mind [I am](https://github.com/leopere/) preferential to receiving patch ## Getting Support -#### Debugpaste [WIP] + #### Creating an Issue Please be sure to fill out the [issue template](https://github.com/lbryio/lbry-docker/issues/new) as best as possible. This will help us answer your questions faster and fix things quicker if we have quality reports. diff --git a/chainquery/linux-x86_64-production/Dockerfile b/chainquery/Dockerfile-linux-x86_64-production similarity index 100% rename from chainquery/linux-x86_64-production/Dockerfile rename to chainquery/Dockerfile-linux-x86_64-production diff --git a/chainquery/compose/docker-compose.yml-prod-example b/chainquery/compose/docker-compose.yml-prod-example index eabb287..5c885a8 100644 --- a/chainquery/compose/docker-compose.yml-prod-example +++ b/chainquery/compose/docker-compose.yml-prod-example @@ -27,16 +27,15 @@ services: ports: - 3306:3306 volumes: - - ./data/db:/var/lib/mysql - - ./stuff/my.cnf:/etc/mysql/conf.d/chainquery-optimizations.cnf + - ../persist/chainquery/db:/var/lib/mysql + ## This one may need to be tweaked based on where you run this docker-compose from. + - ../stuff/my.cnf:/etc/mysql/conf.d/chainquery-optimizations.cnf ################ ## Chainquery ## ################ chainquery: - build: - context: . - target: app + image: lbryio/lbry-docker:linux-x86_64-production restart: always networks: lbry-network: @@ -54,4 +53,4 @@ services: - mysql ## TODO: Uncomment this in a docker-compose.override.yml to allow for external configurations. # volumes: - # - ./data/config/chainqueryconfig.toml:/etc/chainquery/chainqueryconfig.toml + # - ../persist/chainquery/config/chainqueryconfig.toml:/etc/chainquery/chainqueryconfig.toml diff --git a/chainquery/linux-x86_64-compile/.gitkeep b/chainquery/linux-x86_64-compile/.gitkeep deleted file mode 100644 index fb05095..0000000 --- a/chainquery/linux-x86_64-compile/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -# TODO: write compile container diff --git a/lbrycrd/compose/docker-compose.yml-regtest b/lbrycrd/compose/docker-compose.yml-regtest index 2c1017a..424b6a2 100644 --- a/lbrycrd/compose/docker-compose.yml-regtest +++ b/lbrycrd/compose/docker-compose.yml-regtest @@ -5,7 +5,7 @@ services: ## Lbrycrd ## ############# lbrycrd: - image: tiger5226/regtest + image: lbry/lbry-docker:lbrycrd-linux-x86_64-production restart: always ports: - "11336:9246" @@ -13,3 +13,5 @@ services: ## host volumes for persistent data such as wallet private keys. volumes: - "../persist/data:/data" + environment: + - RUN_MODE=regtest diff --git a/lbrycrd/compose/docker-compose.yml-testnet b/lbrycrd/compose/docker-compose.yml-testnet index 103789a..6ccbba8 100644 --- a/lbrycrd/compose/docker-compose.yml-testnet +++ b/lbrycrd/compose/docker-compose.yml-testnet @@ -1,20 +1,11 @@ version: '3.4' -## README -# To run a local instance of testnet via docker: -# -# 1) clone this repository -# -# 2) Run `cd ./lbrycrd/testnet` -# -# 3) Run `docker-compose up -d` - services: ############# ## Lbrycrd ## ############# lbrycrd: - image: tiger5226/testnet + image: lbry/lbry-docker:lbrycrd-linux-x86_64-production restart: always ports: - "11336:9246" @@ -22,3 +13,5 @@ services: ## host volumes for persistent data such as wallet private keys. volumes: - "../persist/data:/data" + environment: + - RUN_MODE=testnet diff --git a/lbrynet/Dockerfile b/lbrynet/Dockerfile-x86_64-production similarity index 51% rename from lbrynet/Dockerfile rename to lbrynet/Dockerfile-x86_64-production index ec3d15c..7130965 100644 --- a/lbrynet/Dockerfile +++ b/lbrynet/Dockerfile-x86_64-production @@ -2,20 +2,18 @@ FROM ubuntu:18.04 LABEL MAINTAINER="leopere [at] nixc [dot] us" -RUN apt-get update && apt-get -y install unzip -RUN adduser lbrynet --gecos GECOS --shell /bin/bash --disabled-password --home /lbrynet/ - ## Add lbrynet ADD https://lbry.io/get/lbrynet.linux.zip /lbrynet/lbrynet.linux.zip -RUN unzip /lbrynet/lbrynet.linux.zip -d /lbrynet/ && \ + +RUN apt-get update && apt-get -y install unzip && \ + adduser lbrynet --gecos GECOS --shell /bin/bash --disabled-password --home /home/lbrynet && \ + unzip /lbrynet/lbrynet.linux.zip -d /lbrynet/ && \ rm /lbrynet/lbrynet.linux.zip && \ chown -Rv lbrynet:lbrynet /lbrynet && \ mv /lbrynet/lbrynet /bin/ - -# COPY stuff/debugpaste-it.sh /usr/local/bin/debugpaste-it + COPY stuff/start.sh /usr/local/bin/start -COPY stuff/docker-entrypoint.sh /usr/local/bin/docker-entrypoint -COPY stuff/healthcheck.sh /usr/local/bin/healthcheck +COPY stuff/checkmount.sh /usr/local/bin/checkmount ## Daemon port [Intended for internal use] ## LBRYNET talks to peers on port 3333 [Intended for external use] this port is used to discover other lbrynet daemons with blobs. @@ -24,21 +22,9 @@ COPY stuff/healthcheck.sh /usr/local/bin/healthcheck ## the lbryumx aka Wallet port [Intended for internal use] EXPOSE 4444 3333 5566 5279 50001 - - -## TODO: Have wallets stored on their own volume/subdirectory for security, and backups. -## Volumize the wallets in a separate location for backup purposes may be unnecessary. -# VOLUME /lbrynet/.local/share/lbry/lbryum/wallets -# VOLUME /lbrynet/.local/ - ## Example daemon_settings.yml is at https://github.com/lbryio/lbry/blob/master/example_daemon_settings.yml ADD https://raw.githubusercontent.com/lbryio/lbry/master/example_daemon_settings.yml /etc/lbrynet/example_daemon_settings.yml -## TODO: In start.sh detect and merge changes. -# VOLUME /etc/lbry/daemon_settings.yml - -## TODO: 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 /lbrynet/Downloads/ - -ENTRYPOINT ["/bin/bash"] - +EXPOSE 5279 +USER lbrynet +ENTRYPOINT ["/usr/local/bin/checkmount"] CMD ["start"] diff --git a/lbrynet/stuff/healthcheck.sh b/lbrynet/stuff/healthcheck.sh deleted file mode 100755 index 2304b1b..0000000 --- a/lbrynet/stuff/healthcheck.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -## TODO: write a healthcheck script. \ No newline at end of file