From af9ba852f624d052e6820c334a9aaf99d1ad614a Mon Sep 17 00:00:00 2001 From: nielsklumper Date: Thu, 16 Apr 2026 12:07:05 +0200 Subject: [PATCH 1/7] feat: add Dockerfile and .dockerignore for containerization --- .dockerignore | 16 ++++++++++++++++ Dockerfile | 29 +++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b4f798e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,16 @@ +.git +.gitignore + +Dockerfile +docker-compose.yml +.dockerignore + +.env +.env.* + +data/ + +vendor/ + +.DS_Store +Thumbs.db \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..059596f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM serversideup/php:8.4-frankenphp-trixie + +USER root + +RUN apt-get update && apt-get install -y --no-install-recommends \ + git \ + unzip \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /var/www/html + +COPY --chown=www-data:www-data composer.json composer.lock* ./ + +RUN composer install \ + --no-interaction \ + --no-progress \ + --prefer-dist \ + --no-dev + +COPY --chown=www-data:www-data . . + +RUN mkdir -p /var/www/html/data \ + && chown -R www-data:www-data /var/www/html + +ENV CADDY_SERVER_ROOT=/var/www/html + +USER www-data + +EXPOSE 8080 \ No newline at end of file From 85fae27037208699e1dcb813b2c0718866401706 Mon Sep 17 00:00:00 2001 From: nielsklumper Date: Thu, 16 Apr 2026 12:24:55 +0200 Subject: [PATCH 2/7] feat: add devcontainer configuration for PHP development environment --- .devcontainer/devcontainer.json | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..4bc4b83 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,36 @@ +{ + "name": "debugphp-server", + "build": { + "dockerfile": "../Dockerfile", + "context": ".." + }, + "overrideCommand": false, + "workspaceMount": "source=${localWorkspaceFolder},target=/var/www/html,type=bind,consistency=cached", + "workspaceFolder": "/var/www/html", + "forwardPorts": [8080], + "portsAttributes": { + "8080": { + "label": "DebugPHP Server" + } + }, + "remoteUser": "www-data", + "containerEnv": { + "CADDY_SERVER_ROOT": "/var/www/html", + "STORAGE_PATH": "/var/www/html/data", + "SESSION_LIFETIME_HOURS": "24" + }, + "postCreateCommand": "composer install", + "customizations": { + "vscode": { + "extensions": [ + "bmewburn.vscode-intelephense-client", + "xdebug.php-pack", + "EditorConfig.EditorConfig" + ], + "settings": { + "php.validate.executablePath": "/usr/local/bin/php", + "intelephense.environment.phpVersion": "8.4" + } + } + } +} \ No newline at end of file From e9eb095a3c5af6d6d52182b10a3f5a41f3167e97 Mon Sep 17 00:00:00 2001 From: Leon Schmidt Date: Mon, 20 Apr 2026 18:53:50 +0200 Subject: [PATCH 3/7] feat: add docker-compose configuration for application services --- docker-compose.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..59279ee --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +services: + app: + build: + context: . + dockerfile: Dockerfile + user: root + ports: + - '8080:8080' + environment: + STORAGE_PATH: /var/www/html/data + SESSION_LIFETIME_HOURS: '24' + volumes: + - ./:/var/www/html:cached + - vendor:/var/www/html/vendor + - data:/var/www/html/data + working_dir: /var/www/html + +volumes: + vendor: + data: From da0bbe79a0f48afc150f4143aeb85d44fbe02ce9 Mon Sep 17 00:00:00 2001 From: Leon Schmidt Date: Mon, 20 Apr 2026 19:13:43 +0200 Subject: [PATCH 4/7] refactor: simplify devcontainer configuration by removing unnecessary build settings --- .devcontainer/devcontainer.json | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4bc4b83..141a660 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,24 +1,16 @@ { "name": "debugphp-server", - "build": { - "dockerfile": "../Dockerfile", - "context": ".." - }, - "overrideCommand": false, - "workspaceMount": "source=${localWorkspaceFolder},target=/var/www/html,type=bind,consistency=cached", + "dockerComposeFile": "../docker-compose.yml", + "service": "app", "workspaceFolder": "/var/www/html", - "forwardPorts": [8080], + "forwardPorts": [ + 8080 + ], "portsAttributes": { "8080": { "label": "DebugPHP Server" } }, - "remoteUser": "www-data", - "containerEnv": { - "CADDY_SERVER_ROOT": "/var/www/html", - "STORAGE_PATH": "/var/www/html/data", - "SESSION_LIFETIME_HOURS": "24" - }, "postCreateCommand": "composer install", "customizations": { "vscode": { From 0caf15799f13ef59e315bee48224c47db4a286cf Mon Sep 17 00:00:00 2001 From: Leon Schmidt Date: Mon, 20 Apr 2026 21:52:13 +0200 Subject: [PATCH 5/7] feat: update ports configuration to use 8787 for debugging and enhance docker-compose setup --- .devcontainer/devcontainer.json | 4 ++-- Dockerfile | 2 +- docker-compose.yml | 35 ++++++++++++++++++++++++++++++--- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 141a660..6abd30d 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,10 +4,10 @@ "service": "app", "workspaceFolder": "/var/www/html", "forwardPorts": [ - 8080 + 8787 ], "portsAttributes": { - "8080": { + "8787": { "label": "DebugPHP Server" } }, diff --git a/Dockerfile b/Dockerfile index 059596f..89280b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,4 +26,4 @@ ENV CADDY_SERVER_ROOT=/var/www/html USER www-data -EXPOSE 8080 \ No newline at end of file +EXPOSE 8787 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 59279ee..f8d8a39 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,18 +3,47 @@ services: build: context: . dockerfile: Dockerfile + container_name: debugphp-server + hostname: debugphp-server user: root ports: - - '8080:8080' + - '8787:8787' environment: - STORAGE_PATH: /var/www/html/data - SESSION_LIFETIME_HOURS: '24' + CADDY_HTTP_PORT: '8787' volumes: - ./:/var/www/html:cached - vendor:/var/www/html/vendor - data:/var/www/html/data working_dir: /var/www/html + networks: + - debugphp + restart: unless-stopped + + network-joiner: + image: docker:cli + container_name: debugphp-network-joiner + restart: unless-stopped + depends_on: + - app + volumes: + - /var/run/docker.sock:/var/run/docker.sock + command: > + sh -c ' + echo "[joiner] starting auto-join loop..."; + while true; do + for net in $$(docker network ls --format "{{.Name}}" | grep -Ev "^(bridge|host|none|debugphp)$$"); do + if ! docker network inspect "$$net" --format "{{range .Containers}}{{.Name}} {{end}}" | grep -q "debugphp-server"; then + docker network connect "$$net" debugphp-server 2>/dev/null && echo "[joiner] joined $$net" || true; + fi; + done; + sleep 10; + done + ' volumes: vendor: data: + +networks: + debugphp: + name: debugphp From 497875ebadc2dc9f239cb149eb26e8a104aa6abe Mon Sep 17 00:00:00 2001 From: Leon Schmidt Date: Mon, 20 Apr 2026 22:47:37 +0200 Subject: [PATCH 6/7] docs: update installation instructions for PHP built-in server and Docker --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fa63c77..5271956 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,22 @@ This is the server and dashboard component of [DebugPHP](https://github.com/Call ## Installation +### Option A — PHP built-in server + ```bash git clone https://github.com/CallMeLeon167/debugphp-server.git cd debugphp-server composer install +php -S localhost:8787 ``` -Then open `http://localhost:8080/setup/` in your browser and follow the setup wizard. +### Option B — Docker + +```bash +git clone https://github.com/CallMeLeon167/debugphp-server.git +cd debugphp-server +docker compose up +``` --- @@ -54,6 +63,16 @@ Debug::send('Hello DebugPHP!'); Debug::send($user, 'User')->color('blue'); ``` +## Running inside Docker? + +Enable auto-detection so the client finds the server automatically: + +```php +Debug::init('your-session-token', [ + 'dockerized' => true, +]); +``` + See the [DebugPHP client repository](https://github.com/CallMeLeon167/debugphp) for the full API documentation. --- From a71e8e19a299d3161c6bffdf931ad60213dde58c Mon Sep 17 00:00:00 2001 From: Leon Schmidt Date: Mon, 20 Apr 2026 22:48:41 +0200 Subject: [PATCH 7/7] update version to 0.4.0 in Config class --- src/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Config.php b/src/Config.php index 60bc1e2..97615c6 100644 --- a/src/Config.php +++ b/src/Config.php @@ -29,7 +29,7 @@ final class Config { /** @var string */ - private string $version = '0.3.2'; + private string $version = '0.4.0'; /** @var self */ private static self $instance;