2
0
mirror of https://github.com/lnbook/lnbook synced 2024-11-18 21:28:03 +00:00

Clean up lnd-run docker

Add entrypoint script, bash alias, log tailing and cleaner startup script
This commit is contained in:
Andreas M. Antonopoulos 2020-06-11 10:43:32 -04:00
parent 7c5d5699bf
commit 28f91cb4b4
5 changed files with 24 additions and 6 deletions

View File

@ -2,8 +2,14 @@ FROM lnbook/lnd-base
ADD lnd /lnd
RUN ln -s /lnd /root/.lnd
ADD fund-lnd.sh /usr/local/bin
RUN chmod +x /usr/local/bin/fund-lnd.sh
ADD bashrc /root/.bashrc
ADD lnd-entrypoint.sh /usr/local/bin
RUN chmod +x /usr/local/bin/lnd-entrypoint.sh
WORKDIR /lnd
CMD /bin/bash lnd-start.sh \
&& sleep 5 \
&& /bin/bash fund-lnd.sh
ENTRYPOINT ["/usr/local/bin/lnd-entrypoint.sh"]
# Show lnd logs from beginning and keep following
CMD ["tail", "-n", "+1", "-f", "/lnd/logs/bitcoin/regtest/lnd.log"]

View File

@ -0,0 +1 @@
alias lncli="lncli --lnddir=/lnd -n regtest"

View File

@ -0,0 +1,14 @@
#!/bin/bash
echo Starting lnd...
lnd --lnddir=/lnd --noseedbackup > /dev/null &
sleep 5
until lncli --lnddir=/lnd -n regtest getinfo > /dev/null 2>&1
do
sleep 1
done
echo "Startup complete"
echo "Funding lnd wallet"
source /usr/local/bin/fund-lnd.sh
exec "$@"

View File

@ -1,3 +0,0 @@
#!/bin/bash
lnd --lnddir=/lnd --noseedbackup