feat: setup devcontainer

This commit is contained in:
Adam Outler
2025-09-19 16:41:28 -04:00
parent 9482e7a720
commit 5ffb6f26e5
19 changed files with 814 additions and 0 deletions

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

@@ -0,0 +1,34 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Python Backend Debug: Attach",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "localhost",
"port": 5678
},
"pathMappings": [
{
// Map workspace root to /app for PHP and other resources, plus explicit server mapping for Python.
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app"
},
{
"localRoot": "${workspaceFolder}/server",
"remoteRoot": "/app/server"
}
]
},
{
"name": "PHP Frontend Xdebug: Listen",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/app": "${workspaceFolder}"
}
}
]
}

13
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,13 @@
{
"terminal.integrated.suggest.enabled": true,
// Use pytest and look under the test/ folder
"python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestArgs": [
"test"
],
// Ensure VS Code uses the devcontainer virtualenv
"python.defaultInterpreterPath": "/opt/venv/bin/python",
// Let the Python extension invoke pytest via the interpreter; avoid hardcoded paths
// Removed python.testing.pytestPath and legacy pytest.command overrides
}

94
.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,94 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Generate Dockerfile",
"type": "shell",
"command": "${workspaceFolder:NetAlertX}/.devcontainer/scripts/generate-dockerfile.sh",
"presentation": {
"echo": true,
"reveal": "always",
"panel": "shared",
"showReuseMessage": false
},
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": false
},
"options": {
"cwd": "${workspaceFolder:NetAlertX}"
},
"icon": {
"id": "tools",
"color": "terminal.ansiYellow"
}
},
{
"label": "Re-Run Startup Script",
"type": "shell",
"command": "${workspaceFolder:NetAlertX}/.devcontainer/scripts/setup.sh",
"presentation": {
"echo": true,
"reveal": "always",
"panel": "shared",
"showReuseMessage": false
},
"problemMatcher": [],
"icon": {
"id": "beaker",
"color": "terminal.ansiBlue"
}
},
{
"label": "Start Backend (Python)",
"type": "shell",
"command": "/workspaces/NetAlertX/.devcontainer/scripts/restart-backend.sh",
"presentation": {
"echo": true,
"reveal": "always",
"panel": "shared",
"showReuseMessage": false,
"clear": false
},
"problemMatcher": [],
"icon": {
"id": "debug-restart",
"color": "terminal.ansiGreen"
}
},
{
"label": "Start Frontend (nginx and PHP-FPM)",
"type": "shell",
"command": "killall php-fpm83 nginx 2>/dev/null || true; sleep 1; php-fpm83 & nginx",
"presentation": {
"echo": true,
"reveal": "always",
"panel": "shared",
"showReuseMessage": false,
"clear": false
},
"problemMatcher": [],
"icon": {
"id": "debug-restart",
"color": "terminal.ansiGreen"
}
},
{
"label": "Stop Frontend & Backend Services",
"type": "shell",
"command": "pkill -f 'php-fpm83|nginx|crond|python3' || true",
"presentation": {
"echo": true,
"reveal": "always",
"panel": "shared",
"showReuseMessage": false
},
"problemMatcher": [],
"icon": {
"id": "debug-stop",
"color": "terminal.ansiRed"
}
}
]
}