Add devcontainer configuration#129
Conversation
|
Thank you for this, but right now we are focused on getting to MVP (minimum viable product) so it can go into the hands of teams for testing. Until we have that, things are changing so fast that we won't be pulling in PRs for other features. I am keeping this open so that we can look at it after we have an MVP out to teams. |
There was a problem hiding this comment.
Pull request overview
This PR adds a VS Code devcontainer + Docker Compose setup to streamline local development and enable GitHub Codespaces usage, along with a few repo hygiene files to standardize contributions and git behavior.
Changes:
- Add
.devcontainer/configuration (Dockerfile, compose, devcontainer.json) to support containerized development. - Update Vite dev server configuration to be reachable from outside the container.
- Add supporting repo files:
.dockerignore,.gitattributes, and a GitHub PR template.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
vite.config.mts |
Makes Vite dev server bind to all interfaces to support container access. |
.devcontainer/Dockerfile |
Defines the container image used for devcontainer/Codespaces. |
.devcontainer/compose.yml |
Defines the app service and workspace mount for devcontainer usage. |
.devcontainer/devcontainer.json |
Configures VS Code devcontainer behavior, extensions, port forwarding, and startup commands. |
.dockerignore |
Reduces Docker build context size by excluding common large/unneeded paths. |
.gitattributes |
Normalizes line endings across platforms. |
.github/PULL_REQUEST_TEMPLATE.md |
Introduces a standardized PR template for contributors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| server: { | ||
| host: true, | ||
| port: 3000, | ||
| }, |
There was a problem hiding this comment.
Setting server.host: true makes the dev server bind to all interfaces (0.0.0.0), which can unintentionally expose the app to the local network when running vite outside a container. Consider scoping this to devcontainer/Codespaces only (e.g., conditional on an env var) or explicitly documenting that the dev server will be network-accessible.
| - ..:/app:cached | ||
| command: sleep infinity | ||
|
|
||
| volumes: | ||
| node_modules: |
There was a problem hiding this comment.
node_modules is declared as a named volume but never mounted, so dependencies installed via postCreateCommand will land in the bind-mounted workspace and get synced (slow) and can differ by host OS. Mount the named volume at /app/node_modules (or use devcontainer mounts) to keep installs container-local and improve performance.
| @@ -0,0 +1,13 @@ | |||
| FROM mcr.microsoft.com/devcontainers/typescript-node:18 | |||
There was a problem hiding this comment.
The devcontainer base image pins Node 18, but the current dependency tree includes packages that declare Node >= 20 in their engines (see package-lock.json). Using Node 18 can lead to install/runtime failures (or strict engine errors). Please update the devcontainer image to a supported Node LTS that matches the project’s requirements (e.g., 20/22).
| FROM mcr.microsoft.com/devcontainers/typescript-node:18 | |
| FROM mcr.microsoft.com/devcontainers/typescript-node:20 |
| RUN npm install | ||
|
|
There was a problem hiding this comment.
RUN npm install during image build is likely wasted work because compose.yml bind-mounts the workspace over /app, which hides the image’s node_modules. Either mount a dedicated node_modules volume so the build-layer install is usable, or remove the build-time install and rely on postCreateCommand (optionally using npm ci for reproducibility).
| RUN npm install |
| 3000 | ||
| ], | ||
| "postCreateCommand": "npm install", | ||
| "postAttachCommand": "npm run start" |
There was a problem hiding this comment.
postAttachCommand runs on every attach/re-attach and may start multiple dev servers (or fail due to port already in use). Prefer postStartCommand (runs once per container start) or add a guard so npm run start only launches if it’s not already running.
| "postAttachCommand": "npm run start" | |
| "postStartCommand": "npm run start" |
|
@dracco1993 - I wanted to make sure you saw that I ran copilot on your PR and it had some suggestions. We are now at a point we could pull this in, if you are still interested. If I haven't heard from you by next week, then I'll close this. |
|
@alan412 I hadn't seen that yet; I can check that out and get some changes made. |
|
@dracco1993 - @lizlooney and I will also be in Houston volunteering for CMP. Find us if you get a chance. We'll both be at the conference talks on the new control system |
Description
Add configuration for
dockervscodedevconatienrBONUS:
.dockerignoreto decrease synced file traffic and improve performance when usingdocker.gitattributesto tell git to use the correct linefeeds, regardless of platform.github/PULL_REQUEST_TEMPLATE.mdto maintain a reasonable standard for PRsMotivation and Context
It helps makes development more straight forward for new contributors.
VsCode
devContainer:Bottom left, click the blue "Open a Remote Window" icon:


Next click "Reopen in Container":
GitHub Codespaces:
This configuration also allows for 1-click style setup using GitHub Codespaces!

After clicking the
+Codespace button here you'll be up and running!Hosted codespace automatically installs dependencies and starts the project:


How Has This Been Tested?
Locally, and through GitHub Codespaces.
Types of changes