Refactor restart script: improve Docker container restart logic and update completion messages

This commit is contained in:
2026-04-28 17:06:37 +02:00
parent 43406c29d1
commit 6f5e24104b
+7 -2
View File
@@ -26,10 +26,15 @@ if ! command -v docker >/dev/null 2>&1; then
exit 1 exit 1
fi fi
echo "Rebuilding and restarting app container using $COMPOSE_FILE..." echo "Rebuilding and/or restarting app container using $COMPOSE_FILE..."
if [ -f "$SCRIPT_DIR/Dockerfile" ]; then
docker compose -f "$COMPOSE_FILE" up -d --build app docker compose -f "$COMPOSE_FILE" up -d --build app
else
echo "Warning: Dockerfile not found in $SCRIPT_DIR. Skipping build and restarting existing app container."
docker compose -f "$COMPOSE_FILE" up -d --no-build app
fi
echo "Cleaning up unused Docker images..." echo "Cleaning up unused Docker images..."
docker image prune -f docker image prune -f
echo "App rebuild complete." echo "App restart complete."