mirror of https://github.com/edouardparis/lntop
docker: drop docker-compose dependency
Instead of relying on docker-compose.yml, we use bash to pass configuration to docker directly via commnad-line args. We also use config template and prior each run we evaluate it with current environment. So that settings like LND_GRPC_HOST can be specified prior each run without a need to rebuild.pull/14/head
parent
2f18d9a37c
commit
9e50120dec
@ -1,2 +1,3 @@
|
|||||||
lntop/_src
|
lntop/_src
|
||||||
_volumes
|
_volumes
|
||||||
|
.envrc
|
@ -0,0 +1,43 @@
|
|||||||
|
## Docker
|
||||||
|
|
||||||
|
To run `lntop` from a docker container:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# you should first review ./lntop/home/initial-config-template.toml
|
||||||
|
# note that paths are relevant to situation inside docker and we run under root
|
||||||
|
# so $HOME directory is /root
|
||||||
|
|
||||||
|
# build the container
|
||||||
|
./build.sh
|
||||||
|
|
||||||
|
# if you have an existing .lntop directory on host machine, you can export it:
|
||||||
|
# export LNTOP_HOME=~/.lntop
|
||||||
|
|
||||||
|
# if you have local lnd node on host machine, point LND_HOME to your actual lnd directory:
|
||||||
|
export LND_HOME=~/.lnd
|
||||||
|
|
||||||
|
# or alternatively if you have remote lnd node, specify paths to auth files explicitly:
|
||||||
|
# export TLS_CERT_FILE=/path/to/tls.cert
|
||||||
|
# export ADMIN_MACAROON_FILE=/path/to/admin.macaroon
|
||||||
|
# export LND_GRPC_HOST=//<remoteip>:10009
|
||||||
|
|
||||||
|
# look into _settings.sh for more details on container configuration
|
||||||
|
|
||||||
|
# run lntop from the container
|
||||||
|
./lntop.sh
|
||||||
|
|
||||||
|
# lntop data will be mapped to host folder at ./_volumes/lntop-data
|
||||||
|
# note that you can review/tweak ./_volumes/lntop-data/config-template.toml after first run
|
||||||
|
# the ./_volumes/lntop-data/config.toml is the effective (generated) config used by lntop run
|
||||||
|
```
|
||||||
|
|
||||||
|
To see `lntop` logs, you can tail them in another terminal session via:
|
||||||
|
```sh
|
||||||
|
./logs.sh -f
|
||||||
|
```
|
||||||
|
|
||||||
|
To start from scratch:
|
||||||
|
```sh
|
||||||
|
./clean.sh
|
||||||
|
./build.sh --no-cache
|
||||||
|
```
|
@ -1,28 +0,0 @@
|
|||||||
# we have a really simple setup here
|
|
||||||
# we use docker-compose only as a convenient way to specify docker build parameters via a yaml file
|
|
||||||
# you could as well use Dockerfile directly with `docker build` and config passed via command-line args
|
|
||||||
#
|
|
||||||
# tips:
|
|
||||||
# - to run lntop from docker, you can use our wrapper script ./lntop.sh
|
|
||||||
# - see other scripts in this folder, also check the docker section in the main readme
|
|
||||||
|
|
||||||
version: '3.7'
|
|
||||||
|
|
||||||
services:
|
|
||||||
|
|
||||||
lntop:
|
|
||||||
image: lntop
|
|
||||||
container_name: lntop
|
|
||||||
command: ["run-service"]
|
|
||||||
network_mode: host
|
|
||||||
build:
|
|
||||||
context: ./lntop
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
args:
|
|
||||||
- LNTOP_SRC_PATH=_src
|
|
||||||
volumes:
|
|
||||||
- $LND_HOME:/root/.lnd
|
|
||||||
- $LNTOP_HOME:/root/.lntop
|
|
||||||
environment:
|
|
||||||
- LNTOP_HOST_UID
|
|
||||||
- LNTOP_HOST_GID
|
|
@ -1,11 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e -o pipefail
|
|
||||||
|
|
||||||
if [[ ! $# -eq 0 ]]; then
|
|
||||||
exec "$@"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "this docker-compose service is not designed to be launched via docker-compose up"
|
|
||||||
echo "exec lntop via ./lntop.sh or directly via docker, e.g. \`docker exec -ti lntop lntop\`"
|
|
||||||
exit 1
|
|
Loading…
Reference in New Issue