devcontainer.json•7.93 kB
{
"name": "NetBox MCP Server Development",
"image": "mcr.microsoft.com/devcontainers/python:3.12-bullseye",
// Features to add to the dev container
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/kubectl-helm-minikube:1": {},
"ghcr.io/devcontainers/features/terraform:1": {},
"ghcr.io/devcontainers/features/azure-cli:1": {},
"ghcr.io/devcontainers/features/aws-cli:1": {}
},
// Configure tool-specific properties
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.pylint",
"ms-python.black-formatter",
"ms-python.isort",
"ms-python.flake8",
"ms-python.mypy-type-checker",
"ms-toolsai.jupyter",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-toolsai.vscode-jupyter-slideshow",
"ms-toolsai.vscode-jupyter-keymap",
"ms-toolsai.vscode-jupyter-renderers",
"ms-vscode.vscode-json",
"redhat.vscode-yaml",
"ms-vscode.vscode-markdown",
"ms-vscode-remote.remote-containers",
"GitHub.copilot",
"GitHub.copilot-chat",
"ms-vscode.test-adapter-converter",
"hbenl.vscode-test-explorer",
"littlefoxteam.vscode-python-test-adapter",
"ms-python.debugpy",
"ms-python.vscode-pylance",
"charliermarsh.ruff",
"tamasfe.even-better-toml",
"ms-vscode.hexeditor",
"ms-vscode.vscode-docker",
"ms-kubernetes-tools.vscode-kubernetes-tools",
"hashicorp.terraform",
"ms-azuretools.vscode-azurecli",
"amazonwebservices.aws-toolkit-vscode"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.flake8Enabled": true,
"python.linting.mypyEnabled": true,
"python.formatting.provider": "black",
"python.sortImports.args": ["--profile", "black"],
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
"tests",
"-v",
"--tb=short"
],
"python.testing.unittestEnabled": false,
"python.testing.nosetestsEnabled": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"files.exclude": {
"**/__pycache__": true,
"**/*.pyc": true,
"**/.pytest_cache": true,
"**/htmlcov": true,
"**/.coverage": true
},
"files.watcherExclude": {
"**/__pycache__/**": true,
"**/.pytest_cache/**": true,
"**/htmlcov/**": true
},
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash",
"args": ["-l"]
}
}
}
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally
"forwardPorts": [8000, 8200, 5432, 8080, 3000],
// Use 'postCreateCommand' to run commands after the container is created
"postCreateCommand": "bash .devcontainer/post-create.sh",
// Use 'postStartCommand' to run commands after the container starts
"postStartCommand": "bash .devcontainer/post-start.sh",
// Configure tool-specific properties
"containerEnv": {
"PYTHONPATH": "/workspaces/mcp-dc/src",
"PYTHONUNBUFFERED": "1",
"PYTHONDONTWRITEBYTECODE": "1",
"MCP_SERVER_LOG_LEVEL": "DEBUG",
"NETBOX_URL": "http://localhost:8000",
"VAULT_ADDR": "http://localhost:8200",
"VAULT_TOKEN": "dev-token",
"POSTGRES_HOST": "localhost",
"POSTGRES_PORT": "5432",
"POSTGRES_DB": "mcp_state",
"POSTGRES_USER": "mcp_user",
"POSTGRES_PASSWORD": "mcp_password"
},
// Use 'mounts' to specify any bind mounts
"mounts": [
"source=${localWorkspaceFolder}/.devcontainer/scripts,target=/usr/local/share/scripts,type=bind,consistency=cached"
],
// Use 'runArgs' to configure Docker
"runArgs": [
"--init",
"--cap-add=SYS_PTRACE",
"--security-opt", "seccomp=unconfined"
],
// Use 'overrideCommand' to replace the default command
"overrideCommand": false,
// Use 'remoteUser' to run as a non-root user
"remoteUser": "vscode",
// Use 'workspaceFolder' to set the default workspace folder
"workspaceFolder": "/workspaces/mcp-dc",
// Use 'workspaceMount' to mount the workspace
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/mcp-dc,type=bind,consistency=cached",
// Use 'shutdownAction' to control what happens when the container shuts down
"shutdownAction": "stopContainer",
// Use 'updateContentCommand' to run commands when the container is updated
"updateContentCommand": "bash .devcontainer/update-content.sh",
// Use 'remoteEnv' to set environment variables
"remoteEnv": {
"PATH": "${containerEnv:PATH}:/usr/local/share/scripts"
},
// Use 'privileged' to run the container in privileged mode
"privileged": false,
// Use 'capAdd' to add capabilities
"capAdd": ["SYS_PTRACE"],
// Use 'securityOpt' to set security options
"securityOpt": ["seccomp=unconfined"],
// Use 'init' to run an init process
"init": true,
// Use 'user' to set the user
"user": "vscode",
// Use 'workspaceFolder' to set the workspace folder
"workspaceFolder": "/workspaces/mcp-dc",
// Use 'postCreateCommand' to run commands after container creation
"postCreateCommand": "bash .devcontainer/post-create.sh",
// Use 'postStartCommand' to run commands after container starts
"postStartCommand": "bash .devcontainer/post-start.sh",
// Use 'updateContentCommand' to run commands when content updates
"updateContentCommand": "bash .devcontainer/update-content.sh",
// Use 'shutdownAction' to control shutdown behavior
"shutdownAction": "stopContainer",
// Use 'overrideCommand' to replace the default command
"overrideCommand": false,
// Use 'mounts' to specify bind mounts
"mounts": [
"source=${localWorkspaceFolder}/.devcontainer/scripts,target=/usr/local/share/scripts,type=bind,consistency=cached"
],
// Use 'runArgs' to configure Docker
"runArgs": [
"--init",
"--cap-add=SYS_PTRACE",
"--security-opt", "seccomp=unconfined"
],
// Use 'forwardPorts' to forward ports
"forwardPorts": [8000, 8200, 5432, 8080, 3000],
// Use 'portsAttributes' to configure port attributes
"portsAttributes": {
"8000": {
"label": "NetBox",
"onAutoForward": "notify"
},
"8200": {
"label": "Vault",
"onAutoForward": "notify"
},
"5432": {
"label": "PostgreSQL",
"onAutoForward": "silent"
},
"8080": {
"label": "MCP Server",
"onAutoForward": "notify"
},
"3000": {
"label": "Development Server",
"onAutoForward": "notify"
}
},
// Use 'otherPortsAttributes' to configure other ports
"otherPortsAttributes": {
"onAutoForward": "silent"
},
// Use 'forwardPorts' to forward ports
"forwardPorts": [8000, 8200, 5432, 8080, 3000],
// Use 'portsAttributes' to configure port attributes
"portsAttributes": {
"8000": {
"label": "NetBox",
"onAutoForward": "notify"
},
"8200": {
"label": "Vault",
"onAutoForward": "notify"
},
"5432": {
"label": "PostgreSQL",
"onAutoForward": "silent"
},
"8080": {
"label": "MCP Server",
"onAutoForward": "notify"
},
"3000": {
"label": "Development Server",
"onAutoForward": "notify"
}
},
// Use 'otherPortsAttributes' to configure other ports
"otherPortsAttributes": {
"onAutoForward": "silent"
}
}