1- // .devcontainer/devcontainer.json v. 1.0.5
1+ // .devcontainer/devcontainer.json v.1.2.0
22
33// This file defines the development container configuration for a Matterbridge Plugin.
44
@@ -32,43 +32,59 @@ Dev containers have networking limitations depending on the host OS and Docker s
3232{
3333 // Name of the dev container
3434 "name" : " Matterbridge Plugin Dev Container" ,
35- // Use the Microsoft pre-built image with Debian (Trixie) and Node.js 24 for a consistent and optimized development environment
36- "image" : " mcr.microsoft.com/devcontainers/javascript-node:24-trixie" ,
35+ "build" : {
36+ "dockerfile" : " Dockerfile"
37+ },
3738 // Inherit timezone from the host environment (set TZ on the host, e.g. Europe/Paris)
3839 "containerEnv" : {
3940 "TZ" : " ${localEnv:TZ}"
4041 },
4142 // Use the non-root node user (passwordless sudo in this image)
4243 "remoteUser" : " node" ,
43- // Mount the local matterbridge and node_modules workspace folder to the container's workspace volumes to improve performance
4444 "mounts" : [
45+ // Package specific volumes for node_modules, .cache, Matterbridge .matterbridge, .mattercert to improve performance
4546 " source=${localWorkspaceFolderBasename}-node_modules,target=${containerWorkspaceFolder}/node_modules,type=volume" ,
4647 " source=${localWorkspaceFolderBasename}-cache,target=${containerWorkspaceFolder}/.cache,type=volume" ,
4748 " source=${localWorkspaceFolderBasename}-plugins,target=/home/node/Matterbridge,type=volume" ,
4849 " source=${localWorkspaceFolderBasename}-storage,target=/home/node/.matterbridge,type=volume" ,
4950 " source=${localWorkspaceFolderBasename}-cert,target=/home/node/.mattercert,type=volume" ,
51+ // Dev container shared volumes for matterbridge, npm cache, bun cache, bash history, claude, codex and agents to improve performance
5052 " source=matterbridge,target=/matterbridge,type=volume" ,
53+ " source=npm-cache,target=/home/node/.npm,type=volume" ,
54+ " source=bun-cache,target=/home/node/.bun/install/cache,type=volume" ,
55+ " source=bash-cache,target=/home/node/.bash-cache,type=volume" ,
5156 " source=claude,target=/home/node/.claude,type=volume" ,
5257 " source=codex,target=/home/node/.codex,type=volume" ,
5358 " source=agents,target=/home/node/.agents,type=volume"
5459 ],
55- // Create the matterbridge Docker network if it doesn't exist, then pull the base image (runs on the HOST before the container starts).
56- "initializeCommand" : " (docker network inspect matterbridge || docker network create matterbridge) && docker pull mcr.microsoft.com/devcontainers/javascript-node:24-trixie " ,
57- // On create, update npm , install and link the dev of matterbridge and install and build the plugin (runs inside the container)
58- "postCreateCommand" : " bash .devcontainer/postCreateCommand .sh" ,
59- // On start, run the plugin in watch mode (runs inside the container)
60- "postStartCommand" : " bash .devcontainer/postStartCommand .sh" ,
60+ // Set up the Docker environment (runs on the host before the container starts)
61+ "initializeCommand" : " bash .devcontainer/initialize.sh " ,
62+ // On create, prepare the directories , install and link the dev of matterbridge and install and build the plugin (runs inside the container)
63+ "postCreateCommand" : " bash .devcontainer/post-create .sh" ,
64+ // On start, install and build the plugin (runs inside the container)
65+ "postStartCommand" : " bash .devcontainer/post-start .sh" ,
6166 "runArgs" : [
6267 // Give the Docker container the same name as the repository (must be unique on host)
6368 " --name" ,
6469 " ${localWorkspaceFolderBasename}" ,
70+ // OpenAI sandbox requisites (https://learn.chatgpt.com/docs/sandboxing?surface=cli)
71+ " --security-opt" ,
72+ " seccomp=unconfined" ,
6573 // Use network host mode if on Docker Engine on Linux or WSL 2 to allow full local network access and mDNS support
6674 // "--network=host"
6775 // Use a shared bridge network to allow to access other containers with their names (dns resolution). With the default bridge, dns resolution does not work (only ip:port).
6876 " --network=matterbridge"
6977 ],
7078 // Publish the Matterbridge UI port on the Docker host (so http://localhost:8283 works even without VS Code port forwarding)
71- "appPort" : [8283 ],
79+ "forwardPorts" : [8283 ],
80+ "portsAttributes" : {
81+ "8283" : {
82+ "label" : " Matterbridge frontend"
83+ }
84+ },
85+ "otherPortsAttributes" : {
86+ "onAutoForward" : " ignore"
87+ },
7288 "customizations" : {
7389 "vscode" : {
7490 // Extensions to install in the dev container
@@ -83,75 +99,8 @@ Dev containers have networking limitations depending on the host OS and Docker s
8399 " github.vscode-pull-request-github" ,
84100 " openai.chatgpt"
85101 ],
86- // Settings for the VS Code environment
102+ // Settings for the VS Code environment specific to the dev container (overrides user and workspace settings)
87103 "settings" : {
88- // Default .vscode/settings.json
89- "eslint.enable" : false ,
90- "prettier.enable" : false ,
91- "oxc.enable" : true ,
92- "js/ts.experimental.useTsgo" : true ,
93- "js/ts.tsdk.promptToUseWorkspaceVersion" : false ,
94- "terminal.integrated.scrollback" : 1000 ,
95- "editor.tabSize" : 2 ,
96- "editor.rulers" : [180 ],
97- "editor.formatOnSave" : false ,
98- "editor.defaultFormatter" : " oxc.oxc-vscode" ,
99- "[javascript]" : { "editor.defaultFormatter" : " oxc.oxc-vscode" },
100- "[typescript]" : { "editor.defaultFormatter" : " oxc.oxc-vscode" },
101- "[json]" : { "editor.defaultFormatter" : " oxc.oxc-vscode" },
102- "[jsonc]" : { "editor.defaultFormatter" : " oxc.oxc-vscode" },
103- "[markdown]" : { "editor.defaultFormatter" : " oxc.oxc-vscode" },
104- "editor.formatOnSaveMode" : " file" ,
105- "editor.codeActionsOnSave" : {
106- "source.format.oxc" : " always" ,
107- "source.fixAll.oxc" : " always"
108- },
109- "diffEditor.ignoreTrimWhitespace" : false ,
110- "files.eol" : " \n " ,
111- "files.insertFinalNewline" : true ,
112- "files.trimFinalNewlines" : true ,
113- "files.trimTrailingWhitespace" : true ,
114- "files.watcherExclude" : {
115- "**/build/**" : true ,
116- "**/.cache/**" : true ,
117- "**/coverage/**" : true
118- },
119- "search.exclude" : {
120- "**/node_modules" : true ,
121- "**/dist" : true ,
122- "**/build" : true ,
123- "**/.cache" : true ,
124- "**/coverage" : true
125- },
126- "git.autofetch" : true ,
127- "git.autoRepositoryDetection" : false ,
128- // VS Code's Copilot Chat extension settings
129- "chat.useCustomizationsInParentRepositories" : true , // Default false.
130- "chat.tools.terminal.autoApprove" : {
131- "npx tsc" : true ,
132- "npx oxlint" : true ,
133- "npx oxfmt" : true ,
134- "npx vitest" : true ,
135- "npm run" : true ,
136- "npm run build" : true ,
137- "npm run typecheck" : true ,
138- "npm run lint" : true ,
139- "npm run format:check" : true ,
140- "npm run test" : true ,
141- "npm run test:coverage" : true ,
142- "npm run update-htmls" : true ,
143- "git status" : true ,
144- "git diff" : true ,
145- "git diff --check" : true ,
146- "git diff --stat" : true ,
147- "git log" : true ,
148- "git show" : true ,
149- "git branch -vv" : true ,
150- "git ls-files" : true ,
151- "git --no-pager diff --stat" : true ,
152- "git --no-pager diff --check" : true
153- },
154- // Dev Container specific settings
155104 "terminal.integrated.defaultProfile.linux" : " bash" ,
156105 "js/ts.tsserver.watchOptions" : {
157106 "watchFile" : " dynamicPriorityPolling" ,
0 commit comments