-
Notifications
You must be signed in to change notification settings - Fork 814
feat: dev container #1367
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
base: v2
Are you sure you want to change the base?
feat: dev container #1367
Changes from all commits
691953e
7d73799
a665410
c796446
60e8380
5c784e5
7b3ee67
701c2ba
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 |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Argument for the pnpm version to install | ||
| ARG PNPM_VERSION="latest" | ||
| # Which image to use as a base | ||
| ARG IMAGE="mcr.microsoft.com/devcontainers/javascript-node" | ||
| # Which tag to use for the image | ||
| ARG VARIANT="20-bookworm" | ||
|
|
||
| # Arguments related to setting up a non-root user for the container | ||
| ARG USERNAME=node | ||
|
|
||
| ######################### | ||
| # Final image | ||
| ######################### | ||
| FROM ${IMAGE}:${VARIANT} | ||
|
|
||
| # Make sure arguments are available | ||
| ARG PNPM_VERSION | ||
| ARG USERNAME | ||
|
|
||
| RUN apt update \ | ||
| # Upgrade the system | ||
| && apt upgrade -yq \ | ||
| # Install general utilities | ||
| && apt install -yq --no-install-recommends sudo software-properties-common ca-certificates apt-transport-https \ | ||
| git git-lfs bash-completion curl wget \ | ||
| # Update ca-certificates | ||
| && update-ca-certificates \ | ||
| # Install package managers | ||
| && npm i -g npm \ | ||
| && npm i -g yarn \ | ||
| && npm i -g pnpm@${PNPM_VERSION} \ | ||
| # Set up pnpm | ||
| && SHELL=bash pnpm setup \ | ||
| # Easier tabbing through files | ||
| && echo "bind TAB:menu-complete" >>/home/${USERNAME}/.bashrc \ | ||
| && echo "bind '\"\e[Z\":menu-complete-backward'" >>/home/${USERNAME}/.bashrc \ | ||
| # Make the user a sudo user | ||
| && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
| && chmod 0440 /etc/sudoers.d/$USERNAME \ | ||
| # Remove some bloat | ||
| && apt clean | ||
|
|
||
| EXPOSE 3000 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| { | ||
| "name": "Tauri Docs", | ||
| "runArgs": [], | ||
| "forwardPorts": [], | ||
| "mounts": [], | ||
| "build": { | ||
| "dockerfile": "Dockerfile", | ||
| "args": {} | ||
| }, | ||
| "customizations": { | ||
| "settings": { | ||
| "extensions.installRecommended": true | ||
| }, | ||
| "extensions": [ | ||
simonhyll marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
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. Not a big fan of pushing all those third party extensions in the container by default. Are they needed for usage or do they provide convenience from your personal perspective?
Contributor
Author
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. The Astro one at least is basically needed for usage. Several of the others are less about being "needed" and more about providing developers with a similar setup of tools related to things like linting and task management. Technically all extensions are always optional, Notepad is the best IDE after all x) Also it's reeeally annoying to have to manually install all recommended extensions when you load up the repo, this is the only way to make it as quick and easy to just boot up and start editing with. Remember that if it's ultimate customization you want a devcontainer may not be the best to use in the first place, and the main purpose of this devcontainer is to get people up and running quickly. That's my take on it at least, but I'm not impossible to convince otherwise. I'm not super emotionally attached to the devcontainer.
Member
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'd rather trim it down to only the Astro extension. The idea of having a dev container in the first place is to get something spun up super quick and easy and we should keep the plugins to a minimum to achieve that. If we slim it down to only Astro's plugin then I think |
||
| "dbaeumer.vscode-eslint", // ESLint | ||
| "waderyan.gitblame", // Shows blame in source code | ||
| "GitHub.vscode-pull-request-github", // Pull requests | ||
| "codezombiech.gitignore", // .gitignore | ||
| "numso.prettier-standard-vscode", // Prettier | ||
| "Gruntfuggly.todo-tree", // To do | ||
| "MarkosTh09.color-picker", // Color picker | ||
| "redhat.vscode-yaml", // Yaml | ||
| "astro-build.astro-vscode" // Astro | ||
| ] | ||
| }, | ||
| "features": {} | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,3 +19,6 @@ pnpm-debug.log* | |
|
|
||
| # macOS-specific files | ||
| .DS_Store | ||
|
|
||
| # PNPM | ||
| .pnpm-store | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| image: | ||
| file: .devcontainer/Dockerfile | ||
| tasks: | ||
| - init: pnpm install && pnpm dev:setup | ||
| command: pnpm run dev | ||
| - init: | | ||
| pnpm install | ||
| pnpm dev:setup | ||
| command: pnpm dev | ||
| ports: | ||
| - port: 3000 | ||
| onOpen: open-browser |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,14 @@ | ||
| { | ||
| "recommendations": ["astro-build.astro-vscode"], | ||
| "recommendations": [ | ||
| "dbaeumer.vscode-eslint", // ESLint | ||
| "waderyan.gitblame", // Shows blame in source code | ||
| "GitHub.vscode-pull-request-github", // Pull requests | ||
| "codezombiech.gitignore", // .gitignore | ||
| "numso.prettier-standard-vscode", // Prettier | ||
| "Gruntfuggly.todo-tree", // To do | ||
| "MarkosTh09.color-picker", // Color picker | ||
| "redhat.vscode-yaml", // Yaml | ||
| "astro-build.astro-vscode" // Astro | ||
| ], | ||
|
Comment on lines
+2
to
+12
Member
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. Some comment on this, let's only do the Astro plugin |
||
| "unwantedRecommendations": [] | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.