diff --git a/lbrycrd/docker-compose.yml b/lbrycrd/docker-compose.yml index d1c2ec3..097d8d4 100644 --- a/lbrycrd/docker-compose.yml +++ b/lbrycrd/docker-compose.yml @@ -17,6 +17,8 @@ services: labels: - "traefik.expose=false" user: "${UID:-1000}:${GID:-1000}" + environment: + RUN_MODE: chainquery expose: - 9245 - 9246 diff --git a/lbrycrd/start.sh b/lbrycrd/start.sh index 66a72f7..b33d1d0 100755 --- a/lbrycrd/start.sh +++ b/lbrycrd/start.sh @@ -20,13 +20,31 @@ echo -e "rpcuser=lbryrpc\nrpcpassword=${RPC_PASSWORD:-changeme}" > ~/.lbrycrd/lb echo -e "rpcallowip=${RPC_ALLOW_IP:-10.5.1.3}" >> ~/.lbrycrd/lbrycrd.conf echo -e "rpcuser=${RPC_USER:-lbryrpc}" >> ~/.lbrycrd/lbrycrd.conf -## For now keeping this simple. Potentially eventually add all command args as envvars for the Dockerfile or use safe way to add args via docker-compose.yml -lbrycrdd \ - -server \ - -txindex \ - -reindex \ - -conf=$HOME/.lbrycrd/lbrycrd.conf \ - -printtoconsole +## Control this invocation through envvar. +case ${$RUN_MODE:-default} in + default ) + lbrycrdd \ + -server \ + -conf=$HOME/.lbrycrd/lbrycrd.conf \ + -printtoconsole + ;; + reindex ) + lbrycrdd \ + -server \ + -txindex \ + -reindex \ + -conf=$HOME/.lbrycrd/lbrycrd.conf \ + -printtoconsole + ;; + chainquery ) + lbrycrdd \ + -server \ + -txindex \ + -conf=$HOME/.lbrycrd/lbrycrd.conf \ + -printtoconsole + ;; +esac + ## We were unsure if these function as intended so they were disabled for the time being. # -port=${PORT:-9246} \