chore: update dev container

This commit is contained in:
Supan Adit Pratama 2025-03-11 07:19:50 +00:00
parent 1282ce00c8
commit a674c2e254
2 changed files with 51 additions and 6 deletions

View File

@ -1,11 +1,8 @@
// For format details, see https://aka.m s/devcontainer.json. For config options, see the // For format details, see https://aka.m s/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/php // README at: https://github.com/devcontainers/templates/tree/main/src/php
{ {
"name": "Todo App", "name": "PHP",
"image": "mcr.microsoft.com/devcontainers/php:1-7.4-bullseye", "image": "mcr.microsoft.com/devcontainers/php:7.4-bullseye",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"workspaceFolder": "/var/www/html",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": { "features": {
"ghcr.io/devcontainers/features/git:1": {} "ghcr.io/devcontainers/features/git:1": {}
}, },
@ -23,7 +20,7 @@
"forwardPorts": [ "forwardPorts": [
8080 8080
], ],
"postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html", // "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html",
// Use 'portsAttributes' to set default properties for specific forwarded ports. More info: https://code.visualstudio.com/docs/remote/devcontainerjson-reference. // Use 'portsAttributes' to set default properties for specific forwarded ports. More info: https://code.visualstudio.com/docs/remote/devcontainerjson-reference.
"portsAttributes": { "portsAttributes": {
"8080": { "8080": {

48
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,48 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003
},
{
"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",
"type": "php",
"request": "launch",
"runtimeArgs": [
"-dxdebug.mode=debug",
"-dxdebug.start_with_request=yes",
"-S",
"localhost:0"
],
"program": "",
"cwd": "${workspaceRoot}",
"port": 9003,
"serverReadyAction": {
"pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",
"uriFormat": "http://localhost:%s",
"action": "openExternally"
}
}
]
}