Skip to content

Commit 7bb8976

Browse files
authored
Add Dev Container (#94)
* Add devcontainer config * Add troubleshooting for Copilot in dev container
1 parent 0c07f56 commit 7bb8976

File tree

4 files changed

+50
-1
lines changed

4 files changed

+50
-1
lines changed

.devcontainer/devcontainer.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "Docusaurus",
3+
"image": "mcr.microsoft.com/devcontainers/typescript-node:22-bookworm",
4+
"features": {},
5+
"forwardPorts": [3000],
6+
"postCreateCommand": "npm install",
7+
"customizations": {
8+
"vscode": {
9+
"extensions": [
10+
"unifiedjs.vscode-mdx",
11+
"esbenp.prettier-vscode",
12+
"davidanson.vscode-markdownlint",
13+
"redhat.vscode-yaml",
14+
"yzhang.markdown-all-in-one"
15+
]
16+
}
17+
}
18+
}

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# CodeGate docs <!-- omit in toc -->
22

3+
[![GitHub deployments](https://img.shields.io/github/deployments/stacklok/codegate-docs/Production?logo=vercel&style=flat&label=Vercel%20deployment)](https://github.com/stacklok/codegate-docs/deployments/Production)
4+
35
This repository contains the public-facing docs for CodeGate, hosted at
46
[https://docs.codegate.ai](https://docs.codegate.ai).
57

@@ -20,6 +22,12 @@ formatting.
2022

2123
## Local development
2224

25+
You'll need Node.js available (v22 recommended) or VS Code with the
26+
[Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
27+
extension and Docker.
28+
29+
[![Open in Dev Containers](https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/stacklok/codegate-docs)
30+
2331
```bash
2432
npm install
2533
npm run start

docs/integrations/copilot.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,29 @@ Here is an example of how to use the `requests` package:
276276
...
277277
```
278278
279+
## Troubleshooting
280+
281+
<details>
282+
<summary>**Issue**: Copilot in VS Code does not work with Dev Containers</summary>
283+
284+
**Details:** The Copilot extensions load within the Dev Container context by
285+
default, but the container cannot reach the CodeGate proxy directly and does not
286+
trust the CodeGate certificate.
287+
288+
**Solution:** The simplest solution which doesn't require modifications to the
289+
devcontainer configuration in your project is to force the Copilot extensions to
290+
run in the UI context instead of remotely. Add the following to your **VS Code
291+
User Settings** file:
292+
293+
```json title="settings.json"
294+
"remote.extensionKind": {
295+
"GitHub.copilot": ["ui"],
296+
"GitHub.copilot-chat": ["ui"]
297+
}
298+
```
299+
300+
</details>
301+
279302
## Next steps
280303
281304
Learn more about CodeGate's features and how to use them:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"prettier": "prettier . --check",
1616
"prettier:fix": "prettier . --write",
1717
"serve": "docusaurus serve",
18-
"start": "docusaurus start",
18+
"start": "docusaurus start --host 0.0.0.0",
1919
"swizzle": "docusaurus swizzle",
2020
"typecheck": "tsc",
2121
"write-heading-ids": "docusaurus write-heading-ids",

0 commit comments

Comments
 (0)