Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Commit d981e4a

Browse files
authored
Merge pull request #1 from codeoverflow-org/add-dev-container
Add devcontainer configuration
2 parents 6466945 + 64ca257 commit d981e4a

File tree

4 files changed

+46
-18
lines changed

4 files changed

+46
-18
lines changed

.devcontainer/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.162.0/containers/typescript-node/.devcontainer/base.Dockerfile
2+
3+
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-14
4+
5+
# Get dependencies that are used by nodecg-io if you do a development build
6+
RUN apt update && apt install libusb-1.0-0-dev libasound2-dev libudev-dev -y
7+
8+
# Update npm to version 7
9+
RUN npm i -g npm@7

.devcontainer/devcontainer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.162.0/containers/typescript-node
3+
{
4+
"name": "Node.js & TypeScript",
5+
"build": {
6+
"dockerfile": "Dockerfile"
7+
},
8+
9+
// Set *default* container specific settings.json values on container create.
10+
"settings": {
11+
"terminal.integrated.shell.linux": "/bin/zsh"
12+
},
13+
14+
// Add the IDs of extensions you want installed when the container is created.
15+
"extensions": ["dbaeumer.vscode-eslint"],
16+
17+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
18+
// 9090 is the default nodecg port if you have setup a nodecg install using the install command and want to test it
19+
"forwardPorts": [9090],
20+
21+
// Use 'postCreateCommand' to run commands after the container is created.
22+
"postCreateCommand": ".devcontainer/postCreate.sh",
23+
24+
"remoteUser": "node"
25+
}

.devcontainer/postCreate.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# Install deps, build cli and link it so it is usable
4+
npm i
5+
npm run build
6+
npm link
7+
8+
# Get nodecg so you can test the cli using this installation
9+
[ ! -d "nodecg" ] && git clone https://github.com/nodecg/nodecg.git
10+
11+
cd nodecg && npm i --prod

package-lock.json

Lines changed: 1 addition & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)