Add devcontainer

This commit is contained in:
JPVenson
2025-08-14 15:32:54 +00:00
parent 2c7d1e422a
commit 5397142a3b
2 changed files with 23 additions and 15 deletions
+15 -15
View File
@@ -1,24 +1,24 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"postAttachCommand": "cat .vscode/extensions.json | jq -r .recommendations[] | xargs -n 1 code --install-extension",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
"postAttachCommand": "cat .vscode/extensions.json | jq -r .recommendations[] | xargs -n 1 code --install-extension",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000]
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Configure tool-specific properties.
// "customizations": {},
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
+8
View File
@@ -26,10 +26,18 @@ npm install
## Local Development
To run locally, please use:
```console
npm start
```
To run within a dev container we have to instruct the build-in hostcheck to bind against all addresses:
```console
npm run start -- --host 0.0.0.0
```
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
## Build