diff --git a/compose/bin/docker-compose b/compose/bin/docker-compose index 0bfc778d7..b7717efe3 100755 --- a/compose/bin/docker-compose +++ b/compose/bin/docker-compose @@ -6,8 +6,24 @@ else DOCKER_COMPOSE="docker-compose" fi -if [ "$1" == "--no-dev" ]; then - ${DOCKER_COMPOSE} -f compose.yaml -f compose.healthcheck.yaml "${@:2}" +DOCKER_COMPOSE_YAMLS=( + compose.yaml + compose.healthcheck.yaml +) + +if [[ -f src/php.ini && -f src/magento-vars.php ]]; then + DOCKER_COMPOSE_YAMLS+=(compose.multi-storefront.yaml) +fi +if [[ $1 = '--no-dev' ]]; then + shift 1 else - ${DOCKER_COMPOSE} -f compose.yaml -f compose.healthcheck.yaml -f compose.dev.yaml "$@" + DOCKER_COMPOSE_YAMLS+=(compose.dev.yaml) fi + +DOCKER_COMPOSE_ARGS=() +for YAML in "${DOCKER_COMPOSE_YAMLS[@]}"; do + DOCKER_COMPOSE_ARGS+=(-f "$YAML") +done +${DOCKER_COMPOSE} \ + "${DOCKER_COMPOSE_ARGS[@]}" \ + "$@" diff --git a/compose/compose.multi-storefront.yaml b/compose/compose.multi-storefront.yaml new file mode 100644 index 000000000..c21008499 --- /dev/null +++ b/compose/compose.multi-storefront.yaml @@ -0,0 +1,12 @@ +version: "3" + +services: + app: + volumes: &appvolumes + # Magento Cloud-like path support + - ./src:/app:cached + # Multi-storefront support depends on "auto_prepend_file = /app/magento-vars.php" being in src/php.ini + - ./src/php.ini:/usr/local/etc/php/conf.d/local-php.ini:cached + + phpfpm: + volumes: *appvolumes