From f4df43f3a11ee86ef1063bf46a5d8c69da141d83 Mon Sep 17 00:00:00 2001 From: 17ms Date: Thu, 11 Jul 2024 20:12:56 +0300 Subject: [PATCH] refactor: healthcheck and deployment script adjustments --- scripts/deploy.sh | 2 +- scripts/healthcheck.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 375f550..e89f41c 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -20,4 +20,4 @@ then fi echo -e "\n[+] Deploying the container with 'docker run' ('data' as the volume)..." -docker run -it -v ./data:/app/data --name chainmapper-prod -d chainmapper +docker run -it --restart unless-stopped -v ./data:/app/data --name chainmapper-prod -d chainmapper diff --git a/scripts/healthcheck.sh b/scripts/healthcheck.sh index 4c3cd4a..9a8d23b 100644 --- a/scripts/healthcheck.sh +++ b/scripts/healthcheck.sh @@ -2,8 +2,11 @@ # Included into the built image via its Dockerfile -if [ -s /app/chainmapper.sqlite3 ]; then +DB_FILE="/app/chainmapper.sqlite3" + +if [ -s $DB_FILE ]; then exit 0 else + echo "Database file not found" exit 1 fi