diff --git a/Makefile b/Makefile index 12aa70d..732963f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ include .stub/*.mk $(eval $(call defw,DOCKER_COMPOSE_LOCAL,docker-compose.local.yml)) +$(eval $(call defw,PROJECT,sylius-standard)) +$(eval $(call defw,NAME,$(PROJECT))) ifneq ("$(wildcard $(DOCKER_COMPOSE_LOCAL))","") DOCKER_COMPOSE_EXTRA_OPTIONS := -f $(DOCKER_COMPOSE_LOCAL) @@ -17,6 +19,7 @@ build:: ##@Docker Build the Sylius application image up:: ##@Sylius Start the Sylius stack for development (using docker-compose) docker-compose \ -f docker-compose.yml \ + -p $(PROJECT) \ $(DOCKER_COMPOSE_EXTRA_OPTIONS) \ up \ --build @@ -25,7 +28,7 @@ up:: ##@Sylius Start the Sylius stack for development (using docker-compose) shell:: ##@Development Bring up a shell docker exec \ -ti \ - syliusdocker_sylius_1 \ + ${NAME}-app \ bash .PHONY: console @@ -33,5 +36,5 @@ console:: ##@Development Call Symfony "console" with "console []" docker exec \ -ti \ -u www-data \ - syliusdocker_sylius_1 \ + ${NAME}-app \ sylius/bin/console $(CMD) diff --git a/docker-compose.yml b/docker-compose.yml index e4be0d1..8e6b191 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,7 @@ version: '2' services: sylius: + container_name: ${NAME}-app build: . environment: - SYLIUS_DATABASE_HOST=mysql @@ -13,6 +14,7 @@ services: - 8000:80 mysql: + container_name: ${NAME}-mysql image: percona:5.7 environment: MYSQL_ROOT_PASSWORD: sylius @@ -23,6 +25,7 @@ services: - 127.0.0.1:3606:3306 mailhog: + container_name: ${NAME}-mailhog image: mailhog/mailhog:latest ports: - 8025:8025