From e856afdc93e7007b53e57f96b78252955fcb3220 Mon Sep 17 00:00:00 2001 From: Tom Wiesing Date: Thu, 12 Nov 2020 18:57:31 +0100 Subject: [PATCH] Rename composer hostnames Previously, all containers had hostnames corresponding to their domains. This made it impossible to use curl and friends from within the containers. This commit renames the hostnames of the containers to append a '.wisski' suffix. --- distillery/resources/compose/barrel/docker-compose.yml | 2 +- distillery/utils/set_trusted_host.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/distillery/resources/compose/barrel/docker-compose.yml b/distillery/resources/compose/barrel/docker-compose.yml index 183f997..21d2de4 100644 --- a/distillery/resources/compose/barrel/docker-compose.yml +++ b/distillery/resources/compose/barrel/docker-compose.yml @@ -4,7 +4,7 @@ services: barrel: build: . restart: always - hostname: ${VIRTUAL_HOST} + hostname: ${VIRTUAL_HOST}.wisski environment: # port and hostname for this image to use VIRTUAL_HOST: ${VIRTUAL_HOST} diff --git a/distillery/utils/set_trusted_host.sh b/distillery/utils/set_trusted_host.sh index 95b4cf4..bd8d1f0 100755 --- a/distillery/utils/set_trusted_host.sh +++ b/distillery/utils/set_trusted_host.sh @@ -3,7 +3,7 @@ # This utility script can be used to configure the trusted host settings inside of settings.php. # It doesn't take care of corner cases and should only be used when needed. -INSTANCE_DOMAIN="$(hostname -f)" +INSTANCE_DOMAIN="${VIRTUAL_HOST}" chmod u+w web/sites/default/settings.php echo "" >> web/sites/default/settings.php echo "\$settings['trusted_host_patterns'] = ['${INSTANCE_DOMAIN//\./\\\.}'];" >> web/sites/default/settings.php