From 041ec4236b4e21da2f48fc83cb23f59b5bebd666 Mon Sep 17 00:00:00 2001 From: Tobias Kolzer Date: Sun, 4 Feb 2024 18:18:53 +0100 Subject: [PATCH] updated supportedapps --- .vscode/launch.json | 15 +++++++++++++++ .vscode/tasks.json | 16 ++++++++++++++++ docker/docker-compose.yml | 26 ++++++++++++++++++++++++++ docker/nginx/Dockerfile | 2 ++ docker/nginx/default.conf | 19 +++++++++++++++++++ docker/php/Dockerfile | 4 ++++ xdebug.ini | 5 +++++ 7 files changed, 87 insertions(+) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json create mode 100644 docker/docker-compose.yml create mode 100644 docker/nginx/Dockerfile create mode 100644 docker/nginx/default.conf create mode 100644 docker/php/Dockerfile create mode 100644 xdebug.ini diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..cda0ab9b --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Listen for Xdebug", + "type": "php", + "request": "launch", + "port": 9003, + "pathMappings": { + "/var/www/html": "${workspaceFolder}" + } + } + ] + } + \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..32c9abbf --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,16 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Start Docker Compose", + "type": "shell", + "command": "docker-compose up --build", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [] + } + ] + } + \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 00000000..ff36b6ae --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,26 @@ +version: "3" +services: + nginx: + build: + context: . + dockerfile: nginx/Dockerfile + ports: + - "8080:80" + networks: + - internal + volumes: + - ../:/var/www/html + php: + build: + context: . + dockerfile: php/Dockerfile + networks: + - internal + environment: + XDEBUG_MODE: debug + XDEBUG_CONFIG: client_host=host.docker.internal client_port=9003 + volumes: + - ../:/var/www/html +networks: + internal: + driver: bridge \ No newline at end of file diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile new file mode 100644 index 00000000..a980286d --- /dev/null +++ b/docker/nginx/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx:alpine +COPY ./default.conf /etc/nginx/conf.d \ No newline at end of file diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf new file mode 100644 index 00000000..5279a273 --- /dev/null +++ b/docker/nginx/default.conf @@ -0,0 +1,19 @@ +server { + listen 0.0.0.0:80; + + root /var/www/html; + + location / { + index index.php index.html; + } + + location ~ \.php$ { + include fastcgi_params; + fastcgi_pass php:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; + } + + error_log /var/log/nginx/error.log; + access_log /var/log/nginx/access.log; +} \ No newline at end of file diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile new file mode 100644 index 00000000..ef9f5785 --- /dev/null +++ b/docker/php/Dockerfile @@ -0,0 +1,4 @@ +FROM php:8.4-fpm + +RUN pecl install xdebug \ + && docker-php-ext-enable xdebug diff --git a/xdebug.ini b/xdebug.ini new file mode 100644 index 00000000..9a38d306 --- /dev/null +++ b/xdebug.ini @@ -0,0 +1,5 @@ +zend_extension=xdebug.so +xdebug.mode=debug +xdebug.start_with_request=yes +xdebug.client_host=host.docker.internal +xdebug.client_port=9003