mirror of https://github.com/edouardparis/lntop
docker: map lntop data as a volume to host folder
parent
3169a9211f
commit
c9e0a51c69
@ -1 +1,2 @@
|
||||
lntop/_src
|
||||
_volumes
|
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
export LND_HOME=${LND_HOME:-$HOME/.lnd}
|
||||
export LNTOP_HOME=${LNTOP_HOME:-./_volumes/lntop-data}
|
||||
export LNTOP_SRC_DIR=${LNTOP_SRC_DIR:-./..}
|
||||
export LNTOP_HOST_UID=${LNTOP_HOST_UID:-$(id -u)}
|
||||
export LNTOP_HOST_GID=${LNTOP_HOST_GID:-$(id -g)}
|
@ -1,16 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
LND_HOME=${LND_HOME:?required}
|
||||
LNTOP_SRC_DIR=${LNTOP_SRC_DIR:-./..}
|
||||
. _settings.sh
|
||||
|
||||
# we rsync repo sources to play well with docker cache
|
||||
echo "Staging lntop source code..."
|
||||
mkdir -p lntop/_src
|
||||
rsync -a --exclude='.git/' --exclude='docker/' --exclude='README.md' --exclude='LICENSE' "$LNTOP_SRC_DIR" lntop/_src
|
||||
rsync -a \
|
||||
--exclude='.git/' \
|
||||
--exclude='.idea/' \
|
||||
--exclude='docker/' \
|
||||
--exclude='README.md' \
|
||||
--exclude='LICENSE' \
|
||||
"$LNTOP_SRC_DIR" \
|
||||
lntop/_src
|
||||
|
||||
echo "Building lntop docker container..."
|
||||
exec docker-compose build "$@" lntop
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e -o pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
LND_HOME=${LND_HOME:?required}
|
||||
. _settings.sh
|
||||
|
||||
exec docker exec -ti lntop fish
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e -o pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
LND_HOME=${LND_HOME:?required}
|
||||
. _settings.sh
|
||||
|
||||
exec docker-compose run --rm --name lntop lntop /sbin/tini -- lntop
|
||||
exec docker-compose run --rm --name lntop lntop /sbin/tini -- run-lntop
|
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e -o pipefail
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
LNTOP_HOME_DIR=.lntop
|
||||
LNTOP_CONFIG="$LNTOP_HOME_DIR/config.toml"
|
||||
LNTOP_HOST_GID=${LNTOP_HOST_GID:?required}
|
||||
LNTOP_HOST_UID=${LNTOP_HOST_UID:?required}
|
||||
|
||||
# make sure lntop's home dir exists (should be mapped to host via a volume)
|
||||
if [[ ! -d "$LNTOP_HOME_DIR" ]]; then
|
||||
mkdir -p "$LNTOP_HOME_DIR"
|
||||
chown ${LNTOP_HOST_UID}:${LNTOP_HOST_GID} "$LNTOP_HOME_DIR"
|
||||
fi
|
||||
|
||||
# prepare config file only if it does not already exist
|
||||
if [[ ! -e "$LNTOP_CONFIG" ]]; then
|
||||
cp initial-config.toml "$LNTOP_CONFIG"
|
||||
chown ${LNTOP_HOST_UID}:${LNTOP_HOST_GID} "$LNTOP_CONFIG"
|
||||
fi
|
||||
|
||||
exec lntop
|
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e -o pipefail
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
LND_HOME=${LND_HOME:?required}
|
||||
. _settings.sh
|
||||
|
||||
exec docker exec lntop tail /root/.lntop/lntop.log "$@"
|
Loading…
Reference in New Issue