Dojo waits for docker image installation; Dojo reinstall resets config

This commit is contained in:
Taylor Helsper 2020-03-01 14:53:50 -06:00
parent a9a039d2ac
commit 708ebda548
7 changed files with 23 additions and 3 deletions

View File

@ -3,11 +3,13 @@
[Unit]
Description=Dojo
After=network.target mynode.service
After=network.target mynode.service docker_images.service
[Service]
Type=forking
RemainAfterExit=yes
ExecStartPre=/usr/bin/wait_on_bitcoin.sh
ExecStartPre=/usr/bin/wait_on_docker_image_install.sh
WorkingDirectory=/opt/mynode/dojo/docker/my-dojo
ExecStart=/opt/mynode/dojo/docker/my-dojo/dojo.sh start
ExecStop=/opt/mynode/dojo/docker/my-dojo/dojo.sh stop

View File

@ -9,6 +9,7 @@ After=www.service docker_images.service
[Service]
EnvironmentFile=/mnt/hdd/mynode/settings/.btcrpc_environment
ExecStartPre=/usr/bin/wait_on_bitcoin.sh
ExecStartPre=/usr/bin/wait_on_docker_image_install.sh
ExecStart=/usr/bin/docker run --rm --name mempoolspace -p 4080:80 -e BITCOIN_NODE_HOST=172.17.0.1 -e BITCOIN_NODE_USER=mynode -e BITCOIN_NODE_PASS=${BTC_RPC_PASSWORD} -e MEMPOOL_REFRESH_RATE_MS=5000 mempoolspace
ExecStop=/usr/bin/docker stop -t 2 mempoolspace

View File

@ -6,6 +6,7 @@ set -x
source /usr/share/mynode/mynode_config.sh
echo "Starting mynode_docker_images.sh ..."
touch /tmp/installing_docker_images
# Drive should be mounted, let's still wait a bit
sleep 10s

View File

@ -6,7 +6,7 @@ sleep 10s #dojo needs time to start before passing next line
# initalize mysql db (REQUIRED TO START MYSQL)
counter=0
target=50
target=100
isRunning=""
MYSQL_DATABASE=samourai-main

View File

@ -45,6 +45,8 @@ elif [ "$APP" = "whirlpool" ]; then
elif [ "$APP" = "dojo" ]; then
rm -f /mnt/hdd/mynode/settings/dojo_url
cd /opt/mynode/dojo/docker/my-dojo/
rm -f ./conf/docker-node.conf
rm -f ./conf/docker-mysql.conf
echo "y" | ./dojo.sh uninstall
else
echo "UNKNOWN APP: $APP"

View File

@ -0,0 +1,14 @@
#!/bin/bash
set -x
# Wait a few second to give marker file a change to get created
sleep 10s
# Check if
echo "Checking if docker images have been installed..."
while [ -f /tmp/installing_docker_images ]; do
sleep 10s
done
exit 0

View File

@ -3,7 +3,7 @@
set -x
set -e
# Wait to see if bitcoind is synced
# Wait to see if electrs is synced
echo "Checking if electrum server is ready is synced..."
while [ ! -f "/tmp/electrs_up_to_date" ]; do
echo "electrs not synced, sleeping 1m"