Repository navigation
feat: added .devcontainer support - #182
fooltinkerer wants to merge 1 commit into
Conversation
|
Hey @fooltinkerer, thanks for the PR. To be honest, I was never really convinced by devcontainers and in my (I'll admit, limited) experience they only make things harder. I feel like the equivalent for Nix or mise would be better, although I use neither. The latter two seem to be more common in projects nowadays than devcontainers. As such, and since I personally won't be using the devcontainer (so if it breaks I'll have no idea), I'd rather not merge this right now. It would be best to either create an issue for this to see whether or not the community needs this, or make this PR a draft and leave it there for the same reason. Sorry! |
|
Hey @sergi0g Thanks a lot for your feedback. No sweat, I understand your point of view and wanted to just make this option available to others. However, no need to do so. I will close the PR and keep it on my disk alone. |
I personally work on different projects and prefer to avoid installing all required tools for each of them on my host. As a result, I make extensive use of
.devcontainerand thought I may let others enjoy this as well by sharing.Architectural decision present in the PR: it uses Docker-in-Docker (Recommended) to obtain a fully isolated environment. As a result, you need to pull sample images to test against.
Documentation excerpt from the commit :
Using the devcontainer
If you would rather not install the toolchain on your machine (or you are not running Linux), the repository includes a devcontainer with Rust, Bun, Node.js and an isolated Docker daemon. All you need is Docker and an editor that supports devcontainers (e.g. VS Code with the Dev Containers extension) or GitHub Codespaces.
Open the repository in your editor and choose "Reopen in Container". On first start, the frontend and docs dependencies are installed and the frontend is built, so
cargo buildworks right away.The Docker daemon inside the container starts empty, so pull a few images to test Cup against (e.g.
docker pull nginx:1.25 alpine:3.18) before runningcargo run -- check. Ports 8000 (cup serve), 5173 (bun devinweb/) and 3000 (bun devindocs/) are forwarded to your machine.