From 7f2cbce5e6ae75cfafe4e51fc4318482e10d9bc9 Mon Sep 17 00:00:00 2001 From: Mark Shust Date: Mon, 20 Dec 2021 11:18:11 -0500 Subject: [PATCH] Fix RabbitMQ connection issues on Windows #426 --- compose/bin/setup | 13 ++++++++----- compose/docker-compose.yml | 12 ++---------- compose/env/elasticsearch.env | 10 ++++++++++ compose/env/rabbitmq.env | 6 ++++++ 4 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 compose/env/rabbitmq.env diff --git a/compose/bin/setup b/compose/bin/setup index 36748977b..d3e50be84 100755 --- a/compose/bin/setup +++ b/compose/bin/setup @@ -7,6 +7,9 @@ source env/db.env source env/elasticsearch.env # shellcheck source=../env/magento.env source env/magento.env +# shellcheck source=../env/rabbitmq.env +source env/rabbitmq.env + DOMAIN=${1:-magento.test} @@ -51,11 +54,11 @@ bin/clinotty bin/magento setup:install \ --language="$MAGENTO_LOCALE" \ --currency="$MAGENTO_CURRENCY" \ --timezone="$MAGENTO_TIMEZONE" \ - --amqp-host=rabbitmq \ - --amqp-port=5672 \ - --amqp-user=guest \ - --amqp-password=guest \ - --amqp-virtualhost=/ \ + --amqp-host="$RABBITMQ_HOST" \ + --amqp-port="$RABBITMQ_PORT" \ + --amqp-user="$RABBITMQ_DEFAULT_USER" \ + --amqp-password="$RABBITMQ_DEFAULT_PASS" \ + --amqp-virtualhost="$RABBITMQ_DEFAULT_VHOST" \ --cache-backend=redis \ --cache-backend-redis-server=redis \ --cache-backend-redis-db=0 \ diff --git a/compose/docker-compose.yml b/compose/docker-compose.yml index 166c8578d..67a1e260a 100644 --- a/compose/docker-compose.yml +++ b/compose/docker-compose.yml @@ -63,14 +63,7 @@ services: ports: - "9200:9200" - "9300:9300" - environment: - - "discovery.type=single-node" - ## Set custom heap size to avoid memory errors - - "ES_JAVA_OPTS=-Xms1g -Xmx1g" - ## Avoid test failures due to small disks - ## More info at https://github.com/markshust/docker-magento/issues/488 - - "cluster.routing.allocation.disk.threshold_enabled=false" - - "index.blocks.read_only_allow_delete" + env_file: env/elasticsearch.env extra_hosts: *appextrahosts rabbitmq: @@ -80,8 +73,7 @@ services: - "5672:5672" volumes: - rabbitmqdata:/var/lib/rabbitmq - environment: - - RABBITMQ_VM_MEMORY_HIGH_WATERMARK=1GB + env_file: env/rabbitmq.env extra_hosts: *appextrahosts mailcatcher: diff --git a/compose/env/elasticsearch.env b/compose/env/elasticsearch.env index 5856225ce..d43fe67fb 100644 --- a/compose/env/elasticsearch.env +++ b/compose/env/elasticsearch.env @@ -1,2 +1,12 @@ ES_HOST=elasticsearch ES_PORT=9200 + +discovery.type=single-node + +# Set custom heap size to avoid memory errors +ES_JAVA_OPTS=-Xms1g -Xmx1g + +# Avoid test failures due to small disks +# More info at https://github.com/markshust/docker-magento/issues/488 +cluster.routing.allocation.disk.threshold_enabled=false +index.blocks.read_only_allow_delete diff --git a/compose/env/rabbitmq.env b/compose/env/rabbitmq.env new file mode 100644 index 000000000..d7ba0e162 --- /dev/null +++ b/compose/env/rabbitmq.env @@ -0,0 +1,6 @@ +RABBITMQ_HOST=rabbitmq +RABBITMQ_PORT=5672 +RABBITMQ_DEFAULT_USER=magento +RABBITMQ_DEFAULT_PASS=magento +RABBITMQ_DEFAULT_VHOST=/ +RABBITMQ_VM_MEMORY_HIGH_WATERMARK=1GB