В конфиге докера починена работа xdebug

This commit is contained in:
ErickSkrauch 2016-05-31 21:05:18 +03:00
parent b5ed01853e
commit c3e7e99baa
6 changed files with 32 additions and 35 deletions

View File

@ -10,7 +10,7 @@ node_modules
*/config/*-local.php
# Все временные файлы
runtime
*/runtime
# Их по идее и не должно образовываться, но мало ли
api/web/assets
# Их по идее их не должно образовываться, но мало ли
*/web/assets

2
.env Normal file
View File

@ -0,0 +1,2 @@
XDEBUG_CONFIG=remote_host=192.168.99.1
PHP_IDE_CONFIG=serverName=docker

View File

@ -33,14 +33,20 @@ RUN apt-get update \
# Поставим xdebug отдельно, т.к. потом его потенциально придётся отсюда убирать
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini
&& echo "xdebug.default_enable=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_handler=dbgp" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_mode=req" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_port=9000" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_connect_back=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.cli_color=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.var_display_max_depth=10" >> /usr/local/etc/php/conf.d/xdebug.ini
# Next composer and global composer package, as their versions may change from time to time
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer.phar \
&& composer.phar global require --no-progress "fxp/composer-asset-plugin:~1.1.4" \
&& composer.phar global require --no-progress "hirak/prestissimo:~0.2.2"
&& composer.phar global require --no-progress "fxp/composer-asset-plugin:~1.1.4" "hirak/prestissimo:~0.2.2"
COPY ./docker/php/composer.sh /usr/local/bin/composer
RUN chmod a+x /usr/local/bin/composer
@ -53,9 +59,8 @@ COPY . /var/www/html
# The following directories are .dockerignored to not pollute the docker images
# with local logs and published assets from development. So we need to create
# empty dirs and set right permissions inside the container.
RUN mkdir api/runtime api/web/assets console/runtime \
RUN mkdir -p api/runtime api/web/assets console/runtime \
&& chown www-data:www-data api/runtime api/web/assets console/runtime
# Expose everything under /var/www (vendor + html)
# This is only required for the nginx setup
VOLUME ["/var/www"]

View File

@ -1,13 +1,18 @@
version: '2'
services:
app:
build: .
expose:
- "9000"
links:
- db
- redis
- rabbitmq
depends_on:
- app-console-account-queue
volumes:
- ./:/var/www/html/
env_file: .env
environment:
ENABLE_ENV_FILE: 1
ENABLE_LOCALCONF: 1
@ -21,16 +26,6 @@ services:
volumes_from:
- app
app:
build: .
expose:
- "9000"
volumes:
- ./:/var/www/html/
environment:
ENABLE_ENV_FILE: 1
ENABLE_LOCALCONF: 1
node-dev-server:
build: ./frontend
ports:

View File

@ -19,11 +19,7 @@ http {
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
keepalive_timeout 10;
server {
listen 80;
@ -50,6 +46,7 @@ http {
fastcgi_pass app:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SERVER_NAME $host;
}
# Раздача статики для frontend
@ -58,10 +55,6 @@ http {
expires max;
access_log off;
}
location ~* \.(htaccess|htpasswd|svn|git) {
deny all;
}
}
}

2
environments/docker/.env Normal file
View File

@ -0,0 +1,2 @@
XDEBUG_CONFIG=remote_host=192.168.99.1
PHP_IDE_CONFIG=serverName=docker