diff --git a/Makefile b/Makefile index 1ec170a25..4b60b0496 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,33 @@ + +ifneq ($(shell which docker-compose 2>/dev/null),) + DOCKER_COMPOSE := docker-compose +else + DOCKER_COMPOSE := docker compose +endif + install: - @docker-compose up -d + $(DOCKER_COMPOSE) up -d remove: @chmod +x confirm_remove.sh @./confirm_remove.sh - start: - @docker-compose start + $(DOCKER_COMPOSE) start startAndBuild: - docker-compose up -d --build + $(DOCKER_COMPOSE) up -d --build stop: - @docker-compose stop + $(DOCKER_COMPOSE) stop update: # Calls the LLM update script chmod +x update_ollama_models.sh @./update_ollama_models.sh @git pull - @docker-compose down + $(DOCKER_COMPOSE) down # Make sure the ollama-webui container is stopped before rebuilding @docker stop open-webui || true - @docker-compose up --build -d - @docker-compose start + $(DOCKER_COMPOSE) up --build -d + $(DOCKER_COMPOSE) start diff --git a/confirm_remove.sh b/confirm_remove.sh index 729c25070..051908e6d 100755 --- a/confirm_remove.sh +++ b/confirm_remove.sh @@ -2,7 +2,12 @@ echo "Warning: This will remove all containers and volumes, including persistent data. Do you want to continue? [Y/N]" read ans if [ "$ans" == "Y" ] || [ "$ans" == "y" ]; then - docker-compose down -v + command docker-compose 2>/dev/null + if [ "$?" == "0" ]; then + docker-compose down -v + else + docker compose down -v + fi else echo "Operation cancelled." fi