Commit ab7d949c authored by Federico Semprini's avatar Federico Semprini
Browse files

Fixed nginx and added debug

parent 84ef9c2d
......@@ -2,6 +2,7 @@ version: '2'
services:
db:
image: mysql
restart: always
ports:
- "13306:3306"
volumes:
......@@ -12,19 +13,20 @@ services:
MYSQL_USER: symfony
MYSQL_PASSWORD: symfony
php:
image: php:7-fpm-alpine
build: ./docker/php-dev
restart: always
volumes:
- ./src:/code
links:
- db
nginx:
image: nginx:alpine
build: ./docker/nginx
restart: always
ports:
- "10080:80"
- "18080:80"
volumes_from:
- php
volumes:
- ./logs/nginx/:/var/log/nginx
- ./docker/nginx:/etc/nginx/conf.d
links:
- php
\ No newline at end of file
FROM nginx:alpine
COPY ./default.conf /etc/nginx/conf.d
\ No newline at end of file
server {
server_name domain.tld www.domain.tld;
root /code/web;
location / {
# try to serve file directly, fallback to app.php
try_files $uri /app.php$is_args$args;
}
location ~ ^/app\.php(/|$) {
# DEV
# This rule should only be placed on your development environment
# In production, don't include this and don't deploy app_dev.php or config.php
location ~ ^/(app_dev|config)\.php(/|$) {
fastcgi_pass php:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_read_timeout 600;
include fastcgi_params;
# When you are using symlinks to link the document root to the
# current version of your application, you should pass the real
# application path instead of the path to the symlink to PHP
# FPM.
# Otherwise, PHP's OPcache may not properly detect changes to
# your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
# for more information).
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
# PROD
location ~ \.php$ {
fastcgi_pass php:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_read_timeout 600;
include fastcgi_params;
# When you are using symlinks to link the document root to the
# current version of your application, you should pass the real
......
FROM php:7-fpm
RUN docker-php-ext-install \
pdo_mysql
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug
COPY ./xdebug.ini /usr/local/etc/php/conf.d/
\ No newline at end of file
xdebug.remote_autostart=true
;zend_extension=xdebug.so
;zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_host="172.18.0.1"
; no need for remote host
xdebug.remote_connect_back=1
xdebug.idekey="phpstorm-xdebug"
;xdebug.remote_log="/tmp/xdebug_log/xdebug.log"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment