Skip to content

Commit

Permalink
Move /app to /srv/api for simpler debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ili101 committed Nov 9, 2023
1 parent ecf33ca commit 8bd41f7
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/compose.devcontainer.yaml
Expand Up @@ -13,7 +13,7 @@ services:

volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- .:/workspace:cached
- .:/srv:cached

environment:
# See https://xdebug.org/docs/all_settings#mode
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Expand Up @@ -17,7 +17,7 @@

// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/workspace",
"workspaceFolder": "/srv",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {
Expand Down
19 changes: 1 addition & 18 deletions .vscode/launch.json
Expand Up @@ -5,17 +5,14 @@
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug (Caddy)",
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
// "log": true,
// "xdebugSettings": {
// "max_data": -1,
// },
"pathMappings": {
"/app": "${workspaceFolder}/api"
},
"ignore": [
// "**/vendor/**",
"**/bootstrap.php",
Expand All @@ -26,20 +23,6 @@
],
// "stopOnEntry": true,
},
{
"name": "Listen for Xdebug (CLI)",
"type": "php",
"request": "launch",
"port": 9003,
// "log": true,
"ignore": [
// "**/vendor/**",
"**/bootstrap.php",
"**/EnvVarProcessor.php",
"**/BaseTestRunner.php",
],
// "stopOnEntry": true,
},
{
"name": "Launch currently open script",
"type": "php",
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
@@ -1,7 +1,7 @@
{
"symfony-vscode.phpExecutablePath": "/usr/local/bin/php",
"phpunit.phpunit": "/workspace/api/bin/phpunit",
"phpunit.phpunit": "/srv/api/bin/phpunit",
"phpunit.args": [
"--configuration /workspace/api/phpunit.xml.dist"
"--configuration /srv/api/phpunit.xml.dist"
],
}
4 changes: 2 additions & 2 deletions api/Dockerfile
Expand Up @@ -17,7 +17,7 @@ FROM composer/composer:2-bin AS composer_upstream
# Base FrankenPHP image
FROM frankenphp_upstream AS frankenphp_base

WORKDIR /app
WORKDIR /srv/api

# persistent / runtime deps
# hadolint ignore=DL3018
Expand Down Expand Up @@ -62,7 +62,7 @@ CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile" ]
FROM frankenphp_base AS frankenphp_dev

ENV APP_ENV=dev XDEBUG_MODE=off
VOLUME /app/var/
VOLUME /srv/api/var/

RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

Expand Down
2 changes: 1 addition & 1 deletion api/frankenphp/Caddyfile
Expand Up @@ -26,7 +26,7 @@
}
}

root * /app/public
root * /srv/api/public
encode zstd gzip

mercure {
Expand Down
2 changes: 1 addition & 1 deletion api/frankenphp/conf.d/app.prod.ini
@@ -1,2 +1,2 @@
opcache.preload_user = root
opcache.preload = /app/config/preload.php
opcache.preload = /srv/api/config/preload.php
6 changes: 3 additions & 3 deletions compose.override.yaml
Expand Up @@ -7,13 +7,13 @@ services:
context: ./api
target: frankenphp_dev
volumes:
- ./api:/app
- /app/var
- ./api:/srv/api
- /srv/api/var
- ./api/frankenphp/Caddyfile:/etc/caddy/Caddyfile:ro
- ./api/frankenphp/conf.d/app.dev.ini:/usr/local/etc/php/conf.d/app.dev.ini:ro
# If you develop on Mac or Windows you can remove the vendor/ directory
# from the bind-mount for better performance by enabling the next line:
#- /app/vendor
#- /srv/api/vendor
environment:
MERCURE_EXTRA_DIRECTIVES: demo
# See https://xdebug.org/docs/all_settings#mode
Expand Down

0 comments on commit 8bd41f7

Please sign in to comment.