-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup and annotate devcontainer.json #58
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,34 @@ | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. .devcontainer/devcontainer.json |
||
// See the devcontainer spec at https://containers.dev/implementors/spec/ | ||
"name": "React Codespaces Template", | ||
|
||
// Container image to build environment from | ||
// universal contains many tools making it useful in many contexts https://github.com/devcontainers/images/tree/main/src/universal | ||
"image": "mcr.microsoft.com/devcontainers/universal:2", | ||
|
||
// Specify the minimum machine spec for running the dev container | ||
"hostRequirements": { | ||
"cpus": 4 | ||
}, | ||
"waitFor": "onCreateCommand", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding is that using this instead of the default That's mostly a moot point, given that we're using prebuilds but still seems valuable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see how it is valuable if we're using Codespaces prebuilds. Help me understand There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two thoughts:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. What would you provide as a comment inline to explain the wait for an empty command? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about: "Allow connecting earlier, while we're still installing dependencies" |
||
|
||
// Upon codespaces or image prebuild, refresh the npm and node.js installation (async from environment creation) | ||
"updateContentCommand": "npm install", | ||
"postCreateCommand": "", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if this was explicitly added to avoid the oryx tool from running? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup it was 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is a dirty hack! No other way to do that? |
||
|
||
// Upon environment create, and after the user session is created, run the server | ||
"postAttachCommand": { | ||
"server": "npm start" | ||
}, | ||
|
||
"customizations": { | ||
// Configure codespaces to open the application source on start | ||
"codespaces": { | ||
"openFiles": [ | ||
"src/App.js" | ||
] | ||
} | ||
}, | ||
|
||
// Configure the environment to open a browser to the application on port 3000 | ||
"portsAttributes": { | ||
"3000": { | ||
"label": "Application", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// See the devcontainer spec at https://containers.dev/implementors/spec/
"name": "React Codespaces Template",
// Container image to build environment from
// universal contains many tools making it useful in many contexts https://github.com/devcontainers/images/tree/main/src/universal
"image": "mcr.microsoft.com/devcontainers/universal:2",
// Specify the minimum machine spec for running the dev container
"hostRequirements": {
"cpus": 4
},