mirror of
https://github.com/aljazceru/cyphernode.git
synced 2026-02-03 19:54:28 +01:00
created structure for configuring services inside a common docker container so the configuration process is os-independant
This commit is contained in:
3
install/.dockerignore
Normal file
3
install/.dockerignore
Normal file
@@ -0,0 +1,3 @@
|
||||
SatoshiPortal
|
||||
data
|
||||
script
|
||||
13
install/Dockerfile
Normal file
13
install/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM alpine
|
||||
|
||||
RUN apk add --update --no-cache \
|
||||
curl \
|
||||
dialog
|
||||
|
||||
RUN mkdir /volume /script /data
|
||||
|
||||
WORKDIR /script
|
||||
|
||||
ENV TRACING=1
|
||||
|
||||
CMD ["./configure.sh"]
|
||||
7
install/bitcoind/script/configure.sh
Executable file
7
install/bitcoind/script/configure.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# TODO: config entry for persistent volume of bitcoind
|
||||
|
||||
dialog --colors --textbox trace.sh 40 80
|
||||
|
||||
|
||||
15
install/bitcoind/script/trace.sh
Normal file
15
install/bitcoind/script/trace.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
trace()
|
||||
{
|
||||
if [ -n "${TRACING}" ]; then
|
||||
echo "[$(date +%Y-%m-%dT%H:%M:%S%z)] ${1}" > /dev/stderr
|
||||
fi
|
||||
}
|
||||
|
||||
trace_rc()
|
||||
{
|
||||
if [ -n "${TRACING}" ]; then
|
||||
echo "[$(date +%Y-%m-%dT%H:%M:%S%z)] Last return code: ${1}" > /dev/stderr
|
||||
fi
|
||||
}
|
||||
11
install/bitcoind/templates/bitcoin.conf
Normal file
11
install/bitcoind/templates/bitcoin.conf
Normal file
@@ -0,0 +1,11 @@
|
||||
# testnet
|
||||
testnet=1
|
||||
|
||||
#lnd opts
|
||||
txindex=1
|
||||
zmqpubrawblock=tcp://0.0.0.0:18501
|
||||
zmqpubrawtx=tcp://0.0.0.0:18502
|
||||
|
||||
# general opts
|
||||
rpcuser=%RPCUSER%
|
||||
rpcpassword=%RPCPASSWORD%
|
||||
20
install/script/cyphernodeconf.sh
Executable file
20
install/script/cyphernodeconf.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
. ./trace.sh
|
||||
|
||||
# this will run configure.sh of the specified package inside a
|
||||
# cyphernodeconf container. This way we ensure we have the right
|
||||
# environment and do not pollute the host machine with utility
|
||||
# commands not needed for runtime
|
||||
|
||||
cyphernodeconf_configure() {
|
||||
PWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||
DATA_PATH=$PWD/../data
|
||||
SCRIPT_PATH=$PWD/../$1/script
|
||||
VOLUME_PATH=/tmp
|
||||
docker run -v $VOLUME_PATH:/volume \
|
||||
-v $DATA_PATH:/data \
|
||||
-v $SCRIPT_PATH:/script\
|
||||
--log-driver=none\
|
||||
--rm -it cyphernodeconf:latest
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
. ./trace.sh
|
||||
. ./docker.sh
|
||||
. ./cyphernodeconf.sh
|
||||
|
||||
trace "Updating SatoshiPortal dockers"
|
||||
git submodule update --recursive --remote
|
||||
@@ -15,3 +16,9 @@ build_docker_image ../SatoshiPortal/dockers/$arch/LN/c-lightning clnimg
|
||||
build_docker_image ../../cron_docker/ proxycronimg
|
||||
build_docker_image ../../proxy_docker/ btcproxyimg
|
||||
build_docker_image ../../pycoin_docker/ pycoinimg
|
||||
|
||||
# build setup docker image
|
||||
build_docker_image ../ cyphernodeconf
|
||||
|
||||
# configure bitcoind
|
||||
cyphernodeconf_configure bitcoind
|
||||
Reference in New Issue
Block a user