Update npmplus-install.sh
This commit is contained in:
parent
76c6499410
commit
828f4ee7c2
@ -69,21 +69,26 @@ yq -i "
|
|||||||
[\"TZ=$TZ_INPUT\", \"ACME_EMAIL=$ACME_EMAIL_INPUT\"])
|
[\"TZ=$TZ_INPUT\", \"ACME_EMAIL=$ACME_EMAIL_INPUT\"])
|
||||||
" /opt/compose.yaml
|
" /opt/compose.yaml
|
||||||
|
|
||||||
msg_info "Building NPMplus"
|
msg_info "Building and Starting NPMplus (Patience)"
|
||||||
$STD docker compose up -d
|
$STD docker compose up -d
|
||||||
CONTAINER_ID=""
|
CONTAINER_ID=""
|
||||||
for i in {1..30}; do
|
for i in {1..60}; do
|
||||||
CONTAINER_ID=$(docker ps --filter "name=npmplus" --format "{{.ID}}")
|
CONTAINER_ID=$(docker ps --filter "name=npmplus" --format "{{.ID}}")
|
||||||
if [[ -n "$CONTAINER_ID" ]]; then
|
if [[ -n "$CONTAINER_ID" ]]; then
|
||||||
STATUS=$(docker inspect --format '{{.State.Health.Status}}' "$CONTAINER_ID" 2>/dev/null || echo "starting")
|
STATUS=$(docker inspect --format '{{.State.Health.Status}}' "$CONTAINER_ID" 2>/dev/null || echo "starting")
|
||||||
if [[ "$STATUS" == "healthy" ]]; then
|
if [[ "$STATUS" == "healthy" ]]; then
|
||||||
|
msg_ok "NPMplus is running and healthy"
|
||||||
break
|
break
|
||||||
|
elif [[ "$STATUS" == "unhealthy" ]]; then
|
||||||
|
msg_error "NPMplus container is unhealthy! Check logs."
|
||||||
|
docker logs "$CONTAINER_ID"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
[[ $i -eq 30 ]] && msg_error "NPMplus container did not become healthy." && exit 1
|
[[ $i -eq 60 ]] && msg_error "NPMplus container did not become healthy within 120s." && docker logs "$CONTAINER_ID" && exit 1
|
||||||
done
|
done
|
||||||
msg_ok "Builded NPMplus"
|
msg_ok "Builded and started NPMplus"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user