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:
parent
7c5d5699bf
commit
28f91cb4b4
@ -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"]
|
||||
|
1
code/docker/lnd-run/bashrc
Normal file
1
code/docker/lnd-run/bashrc
Normal file
@ -0,0 +1 @@
|
||||
alias lncli="lncli --lnddir=/lnd -n regtest"
|
14
code/docker/lnd-run/lnd-entrypoint.sh
Normal file
14
code/docker/lnd-run/lnd-entrypoint.sh
Normal 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 "$@"
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
lnd --lnddir=/lnd --noseedbackup
|
Loading…
Reference in New Issue
Block a user