From f3a6cedcf8653b04f8a4b71c0854dc6b6208059a Mon Sep 17 00:00:00 2001 From: Mark Metcalfe Date: Tue, 26 Nov 2024 10:28:45 +1300 Subject: [PATCH] Remove HOST_IP in favor of host-gateway --- .env.dist | 6 ------ compose/php.yml | 52 ++++++++++++++++++++++++++++++++++++------------- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/.env.dist b/.env.dist index 02cf833..dc68ce8 100644 --- a/.env.dist +++ b/.env.dist @@ -10,12 +10,6 @@ LOCAL_SRC=/your/totara/src/path # Note that specifying just 'php' will automatically use the latest version of PHP that the Totara site supports DEFAULT_CONTAINERS=nginx,pgsql13,php -# set this to your local IP address -# for mac just use "host.docker.internal" -# for linux run command "docker run --rm alpine ip -4 route list match 0/0 | cut -d' ' -f3" and use the resulting ip address -# most probably it is 172.17.0.1 -HOST_IP=host.docker.internal - # Uncomment and change the following to a full path on your host # If not specified tdb will use the folder "tdb_backup" in your home directory #TDB_BACKUP_PATH=/your/path/to/backup/location diff --git a/compose/php.yml b/compose/php.yml index 876102b..6300303 100644 --- a/compose/php.yml +++ b/compose/php.yml @@ -27,7 +27,7 @@ services: environment: CONTAINERNAME: php-5.3-debug TZ: ${TIME_ZONE} - HOST_IP: ${HOST_IP} + HOST_IP: host.docker.internal PHP_IDE_CONFIG: serverName=totara53 HIST_FILE: /root/.bash_history DISABLE_AUTO_UPDATE: "true" # disables oh-my-zsh update message @@ -39,6 +39,8 @@ services: - ./shell:/root/custom_shell networks: - totara + extra_hosts: + - host.docker.internal:host-gateway php-5.4: image: totara/docker-dev-php54 @@ -67,7 +69,7 @@ services: environment: CONTAINERNAME: php-5.4-debug TZ: ${TIME_ZONE} - HOST_IP: ${HOST_IP} + HOST_IP: host.docker.internal PHP_IDE_CONFIG: serverName=totara54 HIST_FILE: /root/.bash_history DISABLE_AUTO_UPDATE: "true" # disables oh-my-zsh update message @@ -79,6 +81,8 @@ services: - ./shell:/root/custom_shell networks: - totara + extra_hosts: + - host.docker.internal:host-gateway php-5.4-cron: image: totara/docker-dev-php54-cron @@ -119,7 +123,7 @@ services: environment: CONTAINERNAME: php-5.5-debug TZ: ${TIME_ZONE} - XDEBUG_CONFIG: remote_host=${HOST_IP} + XDEBUG_CONFIG: remote_host=host.docker.internal PHP_IDE_CONFIG: serverName=totara55 HIST_FILE: /root/.bash_history DISABLE_AUTO_UPDATE: "true" # disables oh-my-zsh update message @@ -131,6 +135,8 @@ services: - ./shell:/root/custom_shell networks: - totara + extra_hosts: + - host.docker.internal:host-gateway php-5.5-cron: image: totara/docker-dev-php55-cron @@ -171,7 +177,7 @@ services: environment: CONTAINERNAME: php-5.6-debug TZ: ${TIME_ZONE} - XDEBUG_CONFIG: remote_host=${HOST_IP} + XDEBUG_CONFIG: remote_host=host.docker.internal PHP_IDE_CONFIG: serverName=totara56 HIST_FILE: /root/.bash_history DISABLE_AUTO_UPDATE: "true" # disables oh-my-zsh update message @@ -183,6 +189,8 @@ services: - ./shell:/root/custom_shell networks: - totara + extra_hosts: + - host.docker.internal:host-gateway php-5.6-cron: image: totara/docker-dev-php56-cron @@ -223,7 +231,7 @@ services: environment: CONTAINERNAME: php-7.0-debug TZ: ${TIME_ZONE} - XDEBUG_CONFIG: remote_host=${HOST_IP} + XDEBUG_CONFIG: remote_host=host.docker.internal PHP_IDE_CONFIG: serverName=totara70 HIST_FILE: /root/.bash_history DISABLE_AUTO_UPDATE: "true" # disables oh-my-zsh update message @@ -235,6 +243,8 @@ services: - ./shell:/root/custom_shell networks: - totara + extra_hosts: + - host.docker.internal:host-gateway php-7.0-cron: image: totara/docker-dev-php70-cron @@ -275,7 +285,7 @@ services: environment: CONTAINERNAME: php-7.1-debug TZ: ${TIME_ZONE} - XDEBUG_CONFIG: remote_host=${HOST_IP} + XDEBUG_CONFIG: remote_host=host.docker.internal PHP_IDE_CONFIG: serverName=totara71 HIST_FILE: /root/.bash_history DISABLE_AUTO_UPDATE: "true" # disables oh-my-zsh update message @@ -287,6 +297,8 @@ services: - ./shell:/root/custom_shell networks: - totara + extra_hosts: + - host.docker.internal:host-gateway php-7.1-cron: image: totara/docker-dev-php71-cron @@ -327,7 +339,7 @@ services: environment: CONTAINERNAME: php-7.2-debug TZ: ${TIME_ZONE} - XDEBUG_CONFIG: client_host=${HOST_IP} + XDEBUG_CONFIG: client_host=host.docker.internal XDEBUG_SESSION: totara72 PHP_IDE_CONFIG: serverName=totara72 HIST_FILE: /root/.bash_history @@ -340,6 +352,8 @@ services: - ./shell:/root/custom_shell networks: - totara + extra_hosts: + - host.docker.internal:host-gateway php-7.2-cron: image: totara/docker-dev-php72-cron @@ -380,7 +394,7 @@ services: environment: CONTAINERNAME: php-7.3-debug TZ: ${TIME_ZONE} - XDEBUG_CONFIG: client_host=${HOST_IP} + XDEBUG_CONFIG: client_host=host.docker.internal XDEBUG_SESSION: totara73 PHP_IDE_CONFIG: serverName=totara73 HIST_FILE: /root/.bash_history @@ -393,6 +407,8 @@ services: - ./shell:/root/custom_shell networks: - totara + extra_hosts: + - host.docker.internal:host-gateway php-7.3-cron: image: totara/docker-dev-php73-cron @@ -433,7 +449,7 @@ services: environment: CONTAINERNAME: php-7.4-debug TZ: ${TIME_ZONE} - XDEBUG_CONFIG: client_host=${HOST_IP} + XDEBUG_CONFIG: client_host=host.docker.internal XDEBUG_SESSION: totara74 PHP_IDE_CONFIG: serverName=totara74 HIST_FILE: /root/.bash_history @@ -446,6 +462,8 @@ services: - ./shell:/root/custom_shell networks: - totara + extra_hosts: + - host.docker.internal:host-gateway php-7.4-cron: image: totara/docker-dev-php74-cron @@ -485,7 +503,7 @@ services: environment: CONTAINERNAME: php-8.0-debug TZ: ${TIME_ZONE} - XDEBUG_CONFIG: client_host=${HOST_IP} + XDEBUG_CONFIG: client_host=host.docker.internal XDEBUG_SESSION: totara80 PHP_IDE_CONFIG: serverName=totara80 HIST_FILE: /root/.bash_history @@ -498,6 +516,8 @@ services: - ./shell:/root/custom_shell networks: - totara + extra_hosts: + - host.docker.internal:host-gateway php-8.0-cron: image: totara/docker-dev-php80-cron @@ -545,7 +565,7 @@ services: environment: CONTAINERNAME: php-8.1-debug TZ: ${TIME_ZONE} - XDEBUG_CONFIG: client_host=${HOST_IP} + XDEBUG_CONFIG: client_host=host.docker.internal XDEBUG_SESSION: totara81 PHP_IDE_CONFIG: serverName=totara81 HIST_FILE: /root/.bash_history @@ -558,6 +578,8 @@ services: - ./shell:/root/custom_shell networks: - totara + extra_hosts: + - host.docker.internal:host-gateway php-8.2: image: totara/docker-dev-php82 @@ -595,7 +617,7 @@ services: environment: CONTAINERNAME: php-8.2-debug TZ: ${TIME_ZONE} - XDEBUG_CONFIG: client_host=${HOST_IP} + XDEBUG_CONFIG: client_host=host.docker.internal XDEBUG_SESSION: totara82 PHP_IDE_CONFIG: serverName=totara82 HIST_FILE: /root/.bash_history @@ -608,6 +630,8 @@ services: - ./shell:/root/custom_shell networks: - totara + extra_hosts: + - host.docker.internal:host-gateway php-8.3: image: totara/docker-dev-php83 @@ -645,7 +669,7 @@ services: environment: CONTAINERNAME: php-8.3-debug TZ: ${TIME_ZONE} - XDEBUG_CONFIG: client_host=${HOST_IP} + XDEBUG_CONFIG: client_host=host.docker.internal XDEBUG_SESSION: totara83 PHP_IDE_CONFIG: serverName=totara83 HIST_FILE: /root/.bash_history @@ -658,6 +682,8 @@ services: - ./shell:/root/custom_shell networks: - totara + extra_hosts: + - host.docker.internal:host-gateway volumes: totara-data: