webserv/.devcontainer/devcontainer.json

72 lines
2.7 KiB
JSON

{
"name": "C++ Development Container",
"dockerFile": "Dockerfile",
// Configure tool-specific properties
"customizations": {
"vscode": {
// Essential C++ development extensions
"extensions": [
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cpptools",
"ms-vscode.cpptools-themes",
"ms-vscode.cmake-tools",
"xaver.clang-format",
"usernamehw.errorlens",
"llvm-vs-code-extensions.vscode-clangd",
"ms-vscode.hexeditor",
"ms-vscode-remote.remote-containers"
],
// Container-specific VS Code settings
"settings": {
"C_Cpp.default.compilerPath": "/usr/bin/clang++-12",
"C_Cpp.default.cStandard": "c17",
"C_Cpp.default.cppStandard": "c++20",
"C_Cpp.default.intelliSenseMode": "linux-clang-x64",
"cmake.configureOnOpen": false,
"clang-format.executable": "/usr/bin/clang-format-12",
"editor.formatOnSave": true,
"[cpp]": {
"editor.defaultFormatter": "xaver.clang-format"
},
"[c]": {
"editor.defaultFormatter": "xaver.clang-format"
},
"files.associations": {
"*.hpp": "cpp",
"*.tpp": "cpp"
}
}
}
},
// Container configuration
// "workspaceFolder": "/workspace",
"remoteUser": "vscode",
// Port forwarding for web server testing
"forwardPorts": [8080, 3000],
"portsAttributes": {
"8080": {
"label": "WebServ Server",
"onAutoForward": "notify"
},
"3000": {
"label": "Development Server",
"onAutoForward": "silent"
}
},
// Additional dev container features (SSH agent removed)
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
// Simple post-create setup
"postCreateCommand": "echo 'Dev container ready! Use GitHub CLI (gh auth login) or configure Git with HTTPS for GitHub access.'"
// Clean build directory and optionally build every time VS Code attaches to container
// "postAttachCommand": "rm -rf /workspaces/webserv/build && echo 'Cleaned build directory for container environment' && (cd /workspaces/webserv && timeout 60 make debug && echo 'Initial build completed successfully' || echo 'Initial build failed or timed out - you can build manually with: make debug') &"
}