host.docker.internalが使える場合は使う
This commit is contained in:
parent
80fe53cf20
commit
34df704fdb
10
dist/bin/tissue-entrypoint.sh
vendored
10
dist/bin/tissue-entrypoint.sh
vendored
@ -3,7 +3,15 @@ set -e
|
|||||||
|
|
||||||
if [[ "$APP_DEBUG" == "true" ]]; then
|
if [[ "$APP_DEBUG" == "true" ]]; then
|
||||||
export PHP_INI_SCAN_DIR=":/usr/local/etc/php/php.d"
|
export PHP_INI_SCAN_DIR=":/usr/local/etc/php/php.d"
|
||||||
export PHP_XDEBUG_REMOTE_HOST=$(cat /etc/hosts | awk 'END{print $1}' | sed -r -e 's/[0-9]+$/1/g')
|
|
||||||
|
php -r "if (gethostbyname('host.docker.internal') === 'host.docker.internal') exit(1);" &> /dev/null
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
# Docker for Windows/Mac
|
||||||
|
export PHP_XDEBUG_REMOTE_HOST='host.docker.internal'
|
||||||
|
else
|
||||||
|
# Docker for Linux
|
||||||
|
export PHP_XDEBUG_REMOTE_HOST=$(cat /etc/hosts | awk 'END{print $1}' | sed -r -e 's/[0-9]+$/1/g')
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec docker-php-entrypoint "$@"
|
exec docker-php-entrypoint "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user