Last active
April 7, 2026 09:30
-
-
Save ikibalnyi/5973db158c26821c2cc0cd626d8c399c to your computer and use it in GitHub Desktop.
Devcontainers setup for VS Code + Run docker-in-docker to isolate devcontainer from host
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "name": "{{PROJECT_NAME}}", | |
| "build": { | |
| "dockerfile": "Dockerfile" | |
| }, | |
| "features": { | |
| "ghcr.io/devcontainers/features/common-utils:2": { | |
| "configureZshAsDefaultShell": true, | |
| "installOhMyZsh": true | |
| }, | |
| "ghcr.io/devcontainers-extra/features/zsh-plugins:0": { | |
| "plugins": "git docker docker-compose" | |
| }, | |
| "ghcr.io/devcontainers/features/docker-in-docker:2": { | |
| "version": "latest", | |
| "dockerDashComposeVersion": "latest" | |
| }, | |
| "ghcr.io/devcontainers/features/node:1": { | |
| "version": "24", | |
| "pnpmVersion": "latest" | |
| } | |
| }, | |
| "customizations": { | |
| "vscode": { | |
| "extensions": [ | |
| "dbaeumer.vscode-eslint", | |
| "esbenp.prettier-vscode", | |
| "bradlc.vscode-tailwindcss", | |
| "ms-vscode.vscode-typescript-next", | |
| "sst-dev.opencode", | |
| "pmneo.tsimporter" | |
| ], | |
| "settings": { | |
| "editor.formatOnSave": true, | |
| "editor.defaultFormatter": "esbenp.prettier-vscode" | |
| } | |
| } | |
| }, | |
| "runArgs": ["--name", "{{PROJECT_NAME}}"], | |
| "postCreateCommand": "sudo mkdir -p /root/.local/share/opencode && sudo chown -R $USER:$USER ./node_modules && pnpm install", | |
| "forwardPorts": [3000,5173], // Ports your projects use | |
| "portsAttributes": { | |
| "3000": { | |
| "label": "Web App", | |
| "onAutoForward": "openBrowser" | |
| } | |
| }, | |
| "workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/{{PROJECT_NAME}},type=bind", | |
| "workspaceFolder": "/workspaces/{{PROJECT_NAME}}", | |
| "containerEnv": { | |
| // "SSH_AUTH_SOCK": "/ssh-agent.sock" | |
| }, | |
| "mounts": [ | |
| // "source=${env:SSH_AUTH_SOCK},target=/ssh-agent.sock,type=bind", | |
| "source=node-modules,target=/workspaces/{{PROJECT_NAME}}/node_modules/,type=volume", | |
| "source=opencode-data,target=/root/.local/share/opencode,type=volume", | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM mcr.microsoft.com/devcontainers/base:noble | |
| WORKDIR /workspaces/{{PROJECT_NAME}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment