From 7dd60a8946be0648c39d5d6c2b1d7bba57a0518b Mon Sep 17 00:00:00 2001 From: martin legrand Date: Tue, 29 Apr 2025 12:01:56 +0200 Subject: [PATCH] fix : start_services.sh not supporting newest docker compose (#137) --- start_services.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/start_services.sh b/start_services.sh index 7a340e7..995f6ff 100755 --- a/start_services.sh +++ b/start_services.sh @@ -41,13 +41,19 @@ else fi # Check if Docker Compose is installed -if ! command_exists docker-compose; then +if ! command_exists docker-compose && ! docker compose version >/dev/null 2>&1; then echo "Error: Docker Compose is not installed. Please install it first." echo "On Ubuntu: sudo apt install docker-compose" echo "Or via pip: pip install docker-compose" exit 1 fi +if command_exists docker-compose; then + COMPOSE_CMD="docker-compose" +else + COMPOSE_CMD="docker compose" +fi + # Check if docker-compose.yml exists if [ ! -f "docker-compose.yml" ]; then echo "Error: docker-compose.yml not found in the current directory." @@ -60,8 +66,8 @@ sleep 4 docker stop $(docker ps -a -q) echo "All containers stopped" -if ! docker-compose up; then - echo "Error: Failed to start containers. Check Docker logs with 'docker compose logs'." +if ! $COMPOSE_CMD up; then + echo "Error: Failed to start containers. Check Docker logs with '$COMPOSE_CMD logs'." echo "Possible fixes: Run with sudo or ensure port 8080 is free." exit 1 fi