diff --git a/.docker/php/Dockerfile b/.docker/php/Dockerfile index 95ef836..baacdfe 100644 --- a/.docker/php/Dockerfile +++ b/.docker/php/Dockerfile @@ -3,6 +3,6 @@ FROM php:8.5.8-cli RUN pecl install xdebug && docker-php-ext-enable xdebug WORKDIR /app -EXPOSE 8000 9003 +EXPOSE 8000 9013 CMD ["php", "-S", "0.0.0.0:8000", "-t", "public", "public/index.php"] diff --git a/.docker/php/xdebug.ini b/.docker/php/xdebug.ini index 918561f..916cc1a 100644 --- a/.docker/php/xdebug.ini +++ b/.docker/php/xdebug.ini @@ -4,6 +4,6 @@ xdebug.mode=develop,debug xdebug.start_with_request=yes xdebug.client_host=host.docker.internal -xdebug.client_port=9003 +xdebug.client_port=9013 xdebug.log_level=0 xdebug.idekey=VSCODE \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index d5e635b..0692010 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,40 +5,17 @@ "version": "0.2.0", "configurations": [ { - "name": "Attach to Chrome", - "port": 9222, - "request": "attach", - "type": "chrome", - "webRoot": "${workspaceFolder}" - }, - - { - "name": "Listen for Xdebug (Docker)", + "name": "API - Listen for Xdebug", "type": "php", "request": "launch", - "port": 9003, + "port": 9013, "pathMappings": { "/app": "${workspaceFolder}" }, "log": true }, { - "name": "Launch currently open script", - "type": "php", - "request": "launch", - "program": "${file}", - "cwd": "${fileDirname}", - "port": 0, - "runtimeArgs": [ - "-dxdebug.start_with_request=yes" - ], - "env": { - "XDEBUG_MODE": "debug,develop", - "XDEBUG_CONFIG": "client_port=${port}" - } - }, - { - "name": "Launch Built-in web server", + "name": "API - Launch Built-in web server", "type": "php", "request": "launch", "runtimeArgs": [ @@ -49,11 +26,15 @@ ], "program": "", "cwd": "${workspaceRoot}", - "port": 9003, + "port": 9013, "serverReadyAction": { "pattern": "Development Server \\(http://localhost:([0-9]+)\\) started", "uriFormat": "http://localhost:%s", "action": "openExternally" + }, + "env": { + "XDEBUG_MODE": "debug,develop", + "XDEBUG_CONFIG": "client_port=${port}" } } ] diff --git a/docker-compose.yml b/docker-compose.yml index 018aa08..d1ab128 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,11 @@ +name: elixforms-ws + services: - elixforms-webservices: + elixforms-ws: build: context: . dockerfile: .docker/php/Dockerfile - container_name: elixforms-webservices + container_name: elixforms-ws working_dir: /app extra_hosts: - "host.docker.internal:host-gateway" diff --git a/docs/http/test_authorization.http b/docs/http/test_authorization.http index 8c3b96a..d3b9a9f 100644 --- a/docs/http/test_authorization.http +++ b/docs/http/test_authorization.http @@ -3,3 +3,17 @@ GET http://localhost:8000/api/dipendenti/cerca?term={{term}} Authorization: Basic elixforms_ws:password123 X-API-Key: myApiAccessToken + +### + +@term=ID + +GET http://localhost:8000/api/contratti/cerca?term={{term}}&cod_fis=MMMPPL74T17E463A +Authorization: Basic elixforms_ws:password123 +X-API-Key: myApiAccessToken + +### + +@term=ID + +GET http://localhost:8000/contratti/cerca?term={{term}} diff --git a/scripts/build-deploy-package.ps1 b/scripts/build-deploy-package.ps1 index 359454f..fc633da 100644 --- a/scripts/build-deploy-package.ps1 +++ b/scripts/build-deploy-package.ps1 @@ -88,6 +88,8 @@ Deploy Apache PHP throw "Compress-Archive non disponibile. Usa Windows PowerShell 5+ o PowerShell 7." } + $outputFile = Resolve-Path -LiteralPath $outputFile + Write-Host "[4/4] Archivio pronto" Write-Host "Percorso: '$outputFile'" Write-Host "" diff --git a/scripts/serve-api.ps1 b/scripts/serve-api.ps1 index 2426142..7f2e035 100644 --- a/scripts/serve-api.ps1 +++ b/scripts/serve-api.ps1 @@ -28,7 +28,7 @@ if (-not (Get-Command composer -ErrorAction SilentlyContinue)) { Push-Location $root try { if ($useDockerComposer) { - docker run --rm -p 8000:8000 -v "$($dockerRoot):/app" -w /app --name php-serve php:8.5.8-cli php -S 0.0.0.0:8000 -t public public/index.php + docker run --rm -p 8000:8000 -v "$($dockerRoot):/app" -w /app --name elixforms-serve-ws php:8.5.8-cli php -S 0.0.0.0:8000 -t public public/index.php } else { php -S 0.0.0.0:8000 -t public public/index.php