Skip to content

Commit c4f4bb8

Browse files
authored
devcontainer (#68)
1 parent c739268 commit c4f4bb8

2 files changed

Lines changed: 50 additions & 15 deletions

File tree

‎.devcontainer/devcontainer.json‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "Local Connectivity Lab",
3+
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm",
4+
"forwardPorts": [
5+
5173
6+
],
7+
"postCreateCommand": "npm install",
8+
"customizations": {
9+
"vscode": {
10+
"extensions": [
11+
"svelte.svelte-vscode"
12+
]
13+
}
14+
},
15+
"postAttachCommand": "npm run dev -- --host 0.0.0.0"
16+
}

‎README.md‎

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,50 @@ The website is hosted on GitHub pages. See `./.github/workflows/static.yml` for
99

1010
## How to update this website
1111

12-
You'll want to run the site locally so you can preview your changes. It's fairly simple to setup if you have any programming experience.
12+
Any updates require a pull request.
1313

14-
Make your changes and confirm them in your locally running site. Commit change to a feature Branch, and create a pull request in GitHub.
14+
Run the site locally so you can preview your changes, then commit changes to a feature branch, and create a pull request in GitHub.
1515

16-
The changes will then need to be reviewed and merged. After merging, a GitHub Action (`./.github/workflows/static.yml`) will kick off to build and deploy the site. This should only take 5 mins, after which your changes will be live!
16+
The changes will then need to be reviewed and merged.
17+
18+
After merging, a GitHub Action (`./.github/workflows/static.yml`) will kick off to build and deploy the site. This should only take 5 mins, after which your changes will be live!
1719

1820

1921
### Local setup
2022

21-
**Install NodeJS** - two options:
23+
There are 2 options with different dependencies and setup. Read through both and choose which will work best for you (or just use the first one).
24+
25+
Either option will start the NodeJs webserver at `http://localhost:5173`.
26+
27+
**First: clone this repo**
28+
29+
#### 1 - No Container
30+
31+
Good if you already use NodeJs, or are not using VS Code.
2232

23-
1. Download and install NodeJS https://nodejs.org/en/download
24-
See `./.nvmrc` for the version of NodeJS to install
25-
1. Use NVM https://github.com/nvm-sh/nvm
33+
1. Install NodeJs
34+
- See `./nvmrc` for the correct version.
35+
- Download and install from https://nodejs.org/en/download
36+
- Or, use a Node version manager (nvm, pnpm etc)
37+
2. Install dependencies
38+
- `npm ci`
39+
3. Run web site
40+
- `npm run dev`
2641

27-
**Setup**
42+
#### 2 - Dev Container
2843

29-
1. Clone the repo
30-
1. Using NVM?
31-
1. `nvm install` to install the correct NodeJS version
32-
1. `nvm use` to use the installed NodeJS version
33-
1. Install dependencies with `npm install`
34-
1. Start a development server `npm run dev`
44+
Good if you don't like using command line, or you like the stability of a container.
3545

36-
Open your browser to http://localhost:5173
46+
1. Install Docker Desktop
47+
- https://www.docker.com/products/docker-desktop/
48+
2. Install VS Code.
49+
- https://code.visualstudio.com/download
50+
3. Install this extension in VS Code
51+
- "Dev Containers" by Microsoft
52+
4. Open the repo in VS Code
53+
5. Run Command Palette (`ctrl`+`shift`+`p`)
54+
- Dev Containers: Reopen in Container
55+
- Wait for the first build to finish
3756

3857

3958
### Update text

0 commit comments

Comments
 (0)