From a711e14115df42d759baf3a24f6d7416b3b947bd Mon Sep 17 00:00:00 2001 From: Samuelfaure Date: Tue, 7 Jan 2025 09:17:53 +0100 Subject: [PATCH] Fix docker-compose file for new syntax --- Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 7d670d3be..740b7e925 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,20 @@ -DOCKER_COMPOSE_CMD = docker-compose -RAILS_DOCKER_CMD = ${DOCKER_COMPOSE_CMD} exec -e POSTGRES_HOST=db web bundle exec rails +ifeq ($(shell which docker-compose),) + DOCKER_COMPOSE = docker compose +else + DOCKER_COMPOSE = docker-compose +endif +RAILS_DOCKER_CMD = ${DOCKER_COMPOSE} exec -e POSTGRES_HOST=db web bundle exec rails install: $(MAKE) stop - $(DOCKER_COMPOSE_CMD) up --build -d + $(DOCKER_COMPOSE) up --build -d $(MAKE) install_database start: - $(DOCKER_COMPOSE_CMD) up -d + $(DOCKER_COMPOSE) up -d stop: - $(DOCKER_COMPOSE_CMD) down + $(DOCKER_COMPOSE) down install_database: $(RAILS_DOCKER_CMD) db:create