Skip to content

Commit

Permalink
container cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rsafier committed Sep 11, 2021
1 parent 06e8df4 commit 2c90834
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
5 changes: 2 additions & 3 deletions bitcoin-signet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ LABEL org.opencontainers.image.authors="Richard Safier"
LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.source="https://github.com/PLEBNET-PLAYGROUND/plebnet-playground-docker"

ENV BITCOIN_DIR /root/.bitcoin
ENV BITCOIN_DATA /data
ENV BITCOIN_DIR /root/.bitcoin

VOLUME $BITCOIN_DATA
VOLUME $BITCOIN_DIR
EXPOSE 8332 8333 28332 28333 28334 38332 38333 38334

COPY --from=builder "/tmp/bin" /usr/local/bin
Expand Down
2 changes: 0 additions & 2 deletions bitcoin-signet/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/bin/bash
set -eo pipefail

mkdir -p "${BITCOIN_DATA}"
mkdir -p "${BITCOIN_DIR}"
ln -sfn "${BITCOIN_DATA}" "${BITCOIN_DIR}"

if [[ ! -f "${BITCOIN_DIR}/bitcoin.conf" ]]; then
echo "bitcoin.conf file not found in volume, copying to ${BITCOIN_DIR}/bitcoin.conf"
Expand Down
12 changes: 12 additions & 0 deletions lnd-signet/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,16 @@ else
echo "lnd.conf file exists, skipping."
fi

localhostip=$(hostname -i)
if [[ -f /root/.lnd/localhostip ]]; then
savedip=$(cat /root/.lnd/localhostip)
if [[ $savedip != $localhostip ]]; then
echo "IP Address changed from ${savedip} to ${localhostip}, cleaning up TLS certs"
#ip changed lets cleanup tls stuff
rm /root/.lnd/tls.key
rm /root/.lnd/tls.cert
fi
fi
echo $localhostip > /root/.lnd/localhostip

exec "$@"

0 comments on commit 2c90834

Please sign in to comment.