Skip to content
Permalink
Browse files

env: Cleanup for Xdebug configuration on dev environment.

  • Loading branch information...
tarlepp committed Jul 29, 2019
1 parent e851377 commit ccf0b20866fdb6399180bb7acc42377f06693398
Showing with 28 additions and 29 deletions.
  1. +2 −13 Dockerfile_dev
  2. +1 −1 docker-entrypoint-dev.sh
  3. +17 −7 docker/php/php-dev.ini
  4. +8 −8 docker/php/php.ini
@@ -45,24 +45,13 @@ ADD . .
# Install bamarni/symfony-console-autocomplete as a global one to get autocomplete working
RUN composer global require bamarni/symfony-console-autocomplete

RUN echo "xdebug.idekey = PHPSTORM" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.default_enable = 0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_enable = 1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_autostart = 1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_connect_back = 0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.profiler_enable = 0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_host = 127.0.0.1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_port = 9009" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

# Ensure that all required files has execute rights
RUN chmod +x /app/bin/console \
&& chmod +x /app/docker-entrypoint-dev.sh \
&& chmod +x /usr/bin/composer

# Allow to use more memory + add necessary stuff to bash autocomplete
RUN echo 'memory_limit = 2048M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini \
&& echo 'expose_php=off' >> /usr/local/etc/php/conf.d/docker-expose-php.ini \
&& echo 'source /usr/share/bash-completion/bash_completion' >> /etc/bash.bashrc \
# Add necessary stuff to bash autocomplete
RUN echo 'source /usr/share/bash-completion/bash_completion' >> /etc/bash.bashrc \
&& echo 'eval "$(symfony-autocomplete --shell bash)"' >> /etc/bash.bashrc

EXPOSE 9000
@@ -27,7 +27,7 @@ else
HOST="docker.for.mac.localhost"
fi

sed -i "s/xdebug\.remote_host \=.*/xdebug\.remote_host\=$HOST/g" /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
sed -i "s/xdebug\.remote_host \=.*/xdebug\.remote_host\=$HOST/g" /usr/local/etc/php/php.ini

export DOCKER_IP=`/sbin/ip route|awk '/default/ { print $3 }'`

@@ -1,15 +1,25 @@
expose_php=off
memory_limit=1024M
short_open_tag=off
expose_php = off
memory_limit = 2048M
short_open_tag = off

; maximum memory that OPcache can use to store compiled PHP files
opcache.memory_consumption=256
opcache.memory_consumption = 256

; maximum number of files that can be stored in the cache
opcache.max_accelerated_files=20000
opcache.max_accelerated_files = 20000

; maximum memory allocated to store the results
realpath_cache_size=4096K
realpath_cache_size = 4096K

; save the results for 10 minutes (600 seconds)
realpath_cache_ttl=600
realpath_cache_ttl = 600

; Xdebug settings
xdebug.idekey = PHPSTORM
xdebug.default_enable = 0
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 0
xdebug.profiler_enable = 0
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9009
@@ -1,18 +1,18 @@
expose_php=off
memory_limit=256M
short_open_tag=off
expose_php = off
memory_limit = 256M
short_open_tag = off

; maximum memory that OPcache can use to store compiled PHP files
opcache.memory_consumption=256
opcache.memory_consumption = 256

; maximum number of files that can be stored in the cache
opcache.max_accelerated_files=20000
opcache.max_accelerated_files = 20000

; in production we don't want to check file timestamps
opcache.validate_timestamps=0
opcache.validate_timestamps = 0

; maximum memory allocated to store the results
realpath_cache_size=4096K
realpath_cache_size = 4096K

; save the results for one hour (3600 seconds)
realpath_cache_ttl=3600
realpath_cache_ttl = 3600

0 comments on commit ccf0b20

Please sign in to comment.
You can’t perform that action at this time.