Skip to content

Commit

Permalink
Fix docker-compose file for new syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelfaure committed Jan 7, 2025
1 parent e510696 commit a711e14
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit a711e14

Please sign in to comment.