commit af43940ba335567870cc71a1f91434299793ce97
Author: Tomáš Ballák <balllak.tomas@gmail.com>
Date:   Thu Apr 30 11:18:45 2020 +0200

    debuger for php works

diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml
index 5d83613..f5acce5 100644
--- a/docker-compose-dev.yml
+++ b/docker-compose-dev.yml
@@ -1,8 +1,10 @@
 version: "3.2"
 services:
        php-fpm:
+               build: './docker/php-fpm/dev'
                volumes:
-                        - vscode-extensions-php:/var/www/symgfony/.vscode-server/extensions
+                        - vscode-extensions-php:/var/www/symfony/.vscode-server/extensions
+                        - ./logs/xdebug:/var/www/symfony/xdebug
        crawler:
                build: 
                         context: ./modules/crawler
diff --git a/docker-compose.yml b/docker-compose.yml
index c4099ff..8088689 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -35,7 +35,7 @@ services:
                ports:
                        - "80:80"
                volumes:
-                       - ./logs:/var/nginx/log
+                       - ./logs/nginx:/var/nginx/log
                        - ./website/:/var/www/symfony
                container_name: "heatmap_nginx"
        database:
diff --git a/docker/php-fpm/dev/Dockerfile b/docker/php-fpm/dev/Dockerfile
index f98a6ba..5466011 100644
--- a/docker/php-fpm/dev/Dockerfile
+++ b/docker/php-fpm/dev/Dockerfile
@@ -2,21 +2,25 @@
 FROM php:7.4-fpm-alpine
 RUN apk update; \
 	apk upgrade; \
+    apk add --no-cache $PHPIZE_DEPS \
+    && pecl install xdebug-2.9.5 \
+    && docker-php-ext-enable xdebug \
 	apk add autoconf openssl-dev g++ make && \
 	pecl install mongodb && \
 	docker-php-ext-enable mongodb; \
 	apk del --purge autoconf openssl-dev g++ make;
-
-RUN echo "**** install Python ****" && \
-    apk add --no-cache python3 && \
-    if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi && \
-    \
-    echo "**** install pip ****" && \
-    python3 -m ensurepip && \
-    rm -r /usr/lib/python*/ensurepip && \
-    pip3 install --no-cache --upgrade pip setuptools wheel && \
-    if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi
 RUN echo "**** install PHP Composer ****\n" && \
     curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
-COPY requirements.txt /requirements.txt
-RUN pip install -r /requirements.txt
\ No newline at end of file
+RUN rm -rf /usr/local/etc/php/conf.d/docker-php-ext-igbinary.ini;
+RUN rm -fr /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini;
+RUN { \
+        echo '[xdebug]'; \
+        echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)"; \
+        echo 'xdebug.remote_enable = 1'; \
+        echo 'xdebug.remote_port = 9001'; \
+        echo 'xdebug.remote_autostart = 1'; \
+        echo 'xdebug.remote_connect_back = 0'; \
+        echo 'xdebug.remote_host = localhost'; \
+        echo 'xdebug.idekey = VSCODE'; \
+        echo 'xdebug.remote_log=/var/www/symfony/xdebug/xdebug.log'; \
+    } > /usr/local/etc/php/conf.d/php-config.ini
diff --git a/docker/php-fpm/dev/xdebug.ini b/docker/php-fpm/dev/xdebug.ini
index efd9594..bdef584 100644
--- a/docker/php-fpm/dev/xdebug.ini
+++ b/docker/php-fpm/dev/xdebug.ini
@@ -1,6 +1,5 @@
 [XDebug]
 xdebug.remote_enable=1
 xdebug.remote_autostart=1
-xdebug.remote_handler=dbgp
-xdebug.remote_port=9000
-xdebug.remote_connect_back=0
\ No newline at end of file
+xdebug.remote_port=9001
+xdebug.remote_connect_back=1
\ No newline at end of file
diff --git a/modules/crawler/.devcontainer/devcontainer.json b/modules/crawler/.devcontainer/devcontainer.json
index 9de6f9d..96c58bb 100644
--- a/modules/crawler/.devcontainer/devcontainer.json
+++ b/modules/crawler/.devcontainer/devcontainer.json
@@ -8,5 +8,5 @@
     "service": "crawler",
     "shutdownAction": "stopCompose",
     "dockerComposeFile": ["../../../docker-compose.yml", "../../../docker-compose-dev.yml"],
-    "mounts":["source=vscode-extensions-php,target=/src/.vscode-server/extensions,type=volume"]
+    "mounts":["source=vscode-extensions-python,target=/src/.vscode-server/extensions,type=volume"]
 }
\ No newline at end of file
diff --git a/website/.devcontainer/devcontainer.json b/website/.devcontainer/devcontainer.json
index 05669f0..08182ff 100644
--- a/website/.devcontainer/devcontainer.json
+++ b/website/.devcontainer/devcontainer.json
@@ -5,8 +5,8 @@
         "ms-python.python",
     ],
     "workspaceFolder": "/var/www/symfony",
-    "build": {
-        "context": ".",
-        "dockerfile": "../../build/php-fpm/dev/Dockerfile"
-    }
+    "service": "php-fpm",
+    "dockerComposeFile": ["../../docker-compose.yml", "../../docker-compose-dev.yml"],
+    "mounts":["source=vscode-extensions-php,target=/var/www/symfony/.vscode-server/extensions,type=volume"]
+
 }
\ No newline at end of file
diff --git a/website/.gitignore b/website/.gitignore
index 947757d..0284b66 100644
--- a/website/.gitignore
+++ b/website/.gitignore
@@ -7,6 +7,7 @@ cache
 /public/bundles/
 /var/
 /vendor/
+.php_cs.cache
 ###< symfony/framework-bundle ###
 
 ###> friendsofphp/php-cs-fixer ###
diff --git a/website/src/Kernel.php b/website/src/Kernel.php
index 1cd0572..232f0dc 100644
--- a/website/src/Kernel.php
+++ b/website/src/Kernel.php
@@ -2,21 +2,21 @@
 
 namespace App;
 
-use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
-use Symfony\Component\Config\Loader\LoaderInterface;
+use const PHP_VERSION_ID;
 use Symfony\Component\Config\Resource\FileResource;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\HttpKernel\Kernel as BaseKernel;
+use Symfony\Component\Config\Loader\LoaderInterface;
 use Symfony\Component\Routing\RouteCollectionBuilder;
+use Symfony\Component\HttpKernel\Kernel as BaseKernel;
+use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use function dirname;
 
-class Kernel extends BaseKernel
-{
+class Kernel extends BaseKernel {
     use MicroKernelTrait;
 
     private const CONFIG_EXTS = '.{php,xml,yaml,yml}';
 
-    public function registerBundles(): iterable
-    {
+    public function registerBundles(): iterable {
         $contents = require $this->getProjectDir().'/config/bundles.php';
         foreach ($contents as $class => $envs) {
             if ($envs[$this->environment] ?? $envs['all'] ?? false) {
@@ -25,15 +25,13 @@ class Kernel extends BaseKernel
         }
     }
 
-    public function getProjectDir(): string
-    {
-        return \dirname(__DIR__);
+    public function getProjectDir(): string {
+        return dirname(__DIR__);
     }
 
-    protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
-    {
+    protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void {
         $container->addResource(new FileResource($this->getProjectDir().'/config/bundles.php'));
-        $container->setParameter('container.dumper.inline_class_loader', \PHP_VERSION_ID < 70400 || $this->debug);
+        $container->setParameter('container.dumper.inline_class_loader', PHP_VERSION_ID < 70400 || $this->debug);
         $container->setParameter('container.dumper.inline_factories', true);
         $confDir = $this->getProjectDir().'/config';
 
@@ -43,8 +41,7 @@ class Kernel extends BaseKernel
         $loader->load($confDir.'/{services}_'.$this->environment.self::CONFIG_EXTS, 'glob');
     }
 
-    protected function configureRoutes(RouteCollectionBuilder $routes): void
-    {
+    protected function configureRoutes(RouteCollectionBuilder $routes): void {
         $confDir = $this->getProjectDir().'/config';
 
         $routes->import($confDir.'/{routes}/'.$this->environment.'/*'.self::CONFIG_EXTS, '/', 'glob');
diff --git a/website/symfony.code-workspace b/website/symfony.code-workspace
index ad6a3ac..9b2bdce 100644
--- a/website/symfony.code-workspace
+++ b/website/symfony.code-workspace
@@ -7,41 +7,68 @@
 	"settings": {
 		"php.suggest.basic":false,
 		"files.autoSave": "afterDelay",
+		"php-cs-fixer.executablePath": "/var/www/symfony/vendor/bin/php-cs-fixer",
+		"php-cs-fixer.config": ".php_cs;.php_cs.dist",
+		"php-cs-fixer.onsave": true
 	},
 	"extensions": {
 		"recommendations": [
 			"vscode-icons-team.vscode-icons",
 			"felixfbecker.php-intellisense",
-			"whatwedo.twig"
+			"whatwedo.twig",
+			"felixfbecker.php-debug",
+			"junstyle.php-cs-fixer"
 		]
 	},
 	"tasks": {
 		"version": "2.0.0",
 		"tasks": [{
-			"label": "PHP Linter",
+			"label": "PHP Linter (DOCKER SERVICE)",
 			"command": "docker-compose",
-			"args": ["exec", "php-fpm", "/var/www/symfony/vendor/bin/php-cs-fixer","fix", "--dry-run", "--config", "/var/www/symfony/.php_cs", "--stop-on-violation", "--using-cache=no"],
+			"args": ["exec", "php-fpm", "./vendor/bin/php-cs-fixer", "fix", "/var/www/symfony/src", "--dry-run", "--config", "/var/www/symfony/.php_cs", "--stop-on-violation", "--using-cache=no"],
 			"windows":{
 				"command": "docker-compose",
-				"args": ["exec", "php-fpm", "/var/www/symfony/vendor/bin/php-cs-fixer", "fix", "--dry-run", "--config", "/var/www/symfony/.php_cs", "--stop-on-violation", "--using-cache=no"],
+				"args": ["exec", "php-fpm","./vendor/bin/php-cs-fixer", "fix", "/var/www/symfony/src", "--dry-run", "--config", "/var/www/symfony/.php_cs", "--stop-on-violation", "--using-cache=no"],
 			}
 		},
 		{
-			"label": "Format",
+			"label": "Format (DOCKER SERVICE)",
+			"command": "docker-compose",
+			"args": ["exec", "php-fpm", "/var/www/symfony/vendor/bin/php-cs-fixer", "fix", "/var/www/symfony/src", "--config", "/var/www/symfony/.php_cs", "--stop-on-violation"],
+			"windows":{
+				"command": "docker-compose",
+				"args": ["exec", "php-fpm", "/var/www/symfony/vendor/bin/php-cs-fixer", "fix", "/var/www/symfony/src", "--config", "/var/www/symfony/.php_cs", "--stop-on-violation"],
+			}
+		},{
+			"label": "PHP Linter",
 			"command": "docker-compose",
-			"args": ["exec", "php-fpm", "/var/www/symfony/vendor/bin/php-cs-fixer","fix", "--config", "/var/www/symfony/.php_cs", "--stop-on-violation"],
+			"args": ["exec", "php-fpm", "./vendor/bin/php-cs-fixer", "fix", "/var/www/symfony/src", "--dry-run", "--config", "/var/www/symfony/.php_cs", "--stop-on-violation", "--using-cache=no"],
 			"windows":{
 				"command": "docker-compose",
-				"args": ["exec", "php-fpm", "/var/www/symfony/vendor/bin/php-cs-fixer", "fix", "--config", "/var/www/symfony/.php_cs", "--stop-on-violation"],
+				"args": ["exec", "php-fpm","./vendor/bin/php-cs-fixer", "fix", "/var/www/symfony/src", "--dry-run", "--config", "/var/www/symfony/.php_cs", "--stop-on-violation", "--using-cache=no"],
+			}
+		},
+		{
+			"label": "Format",
+			"command": "./vendor/bin/php-cs-fixer",
+			"args": ["fix", "/var/www/symfony/src", "--config", "/var/www/symfony/.php_cs", "--stop-on-violation"],
+			"windows":{
+				"command": "./vendor/bin/php-cs-fixer",
+				"args": ["fix", "/var/www/symfony/src", "--config", "/var/www/symfony/.php_cs", "--stop-on-violation"],
 			}
 		}]
 	},
 	"launch": {
-		"configurations": [{
+		"configurations": [
+			{
             "name": "Listen for XDebug",
             "type": "php",
-            "request": "launch",
-			"port": 9000
+			"request": "launch",
+			"log": true,
+			"pathMappings": {
+				"/var/www/symfony": "${workspaceFolder}/"
+			},
+			"port": 9001
 			}]
 	}
 }
\ No newline at end of file
