feat: rebase main devcontainer recommendation on compose+Dockerfile setup#77
Open
marcelocra wants to merge 3 commits into
Open
feat: rebase main devcontainer recommendation on compose+Dockerfile setup#77marcelocra wants to merge 3 commits into
marcelocra wants to merge 3 commits into
Conversation
…etup
Replace the image/features-only devcontainer with a Docker Compose based
setup (devcontainer.json + docker-compose.yml + Dockerfile + .env),
modeled on a battle-tested real-world config:
- devcontainer.json forwards host TZ/locale via ${localEnv:*} instead of
hardcoding values, and derives its name/workspaceFolder from the
project folder
- docker-compose.yml targets Docker (Podman users get a note on building
the image manually), keeps the tmpfs /tmp mount, mounts host
~/.config/dotfiles, and keeps the auxiliary services (Postgres, Redis,
MongoDB, MinIO, Ollama) behind Compose profiles
- Dockerfile pins the typescript-node image and adds tmux, neovim,
ripgrep and fd
- .env(.example) carries COMPOSE_PROJECT_NAME, which must match the
project folder name
The installer (devmagic.run/install) now downloads all files into
.devcontainer/ in the current directory and generates .env from the
folder name (sanitized for Compose).
Update README, docs/ARCHITECTURE.md and the website (getting-started
file tree, prerequisites now Docker-first, install flow and dotfiles
sections in both locales) to match: dotfiles are mounted from the host
rather than cloned, and the setup script is an opt-in postCreateCommand.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuKjgTCp3QuvUWqxPf7Q1y
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
…zation
- Restore the ${HOME}${USERPROFILE} cross-platform home path for the
dotfiles and Ollama host mounts so Windows hosts don't expand to a
bogus root-level path
- When the folder name isn't Compose-safe, the installer now patches
workspaceFolder in devcontainer.json to the sanitized name instead of
asking the user to edit it by hand
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuKjgTCp3QuvUWqxPf7Q1y
Address review feedback: - Stop committing .devcontainer/.env — only .env.example ships with the repo; the installer generates .env per project (compose falls back to sane defaults without it) - Make .env.example the canonical reference for every value shared between devcontainer.json and docker-compose.yml, documenting that devcontainer.json cannot read .env (localEnv reads host variables) and which values are matched by convention - Load .env into the dev container's runtime environment via env_file (required: false), so scripts inside the container see the same values compose interpolates with - Slim docker-compose.yml down to the dev service plus one commented PostgreSQL example behind a profile, keeping dev-network; README's auxiliary-services section shrinks accordingly - Simplify the landing page: drop the standalone/contribute cards and the Quick Start section, add a one-line quick start (Docker + VS Code + reopen in container) under the hero install command, and remove the now-unused strings from both locales Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuKjgTCp3QuvUWqxPf7Q1y
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the image/features-only devcontainer with a Docker Compose based setup (
devcontainer.json+docker-compose.yml+Dockerfile+.env), modeled on a battle-tested real-world config, and updates the installer and website to match.New
.devcontainer/(main recommendation)devcontainer.json— Compose-based;nameandworkspaceFolderderive from${localWorkspaceFolderBasename};TZ/LC_ALL/LANGforwarded from the host via${localEnv:VAR:fallback}instead of hardcoded values;github-clifeature active (docker-in-docker and git-lfs commented); the devmagic.run/setup script kept as a commented opt-inpostCreateCommand.docker-compose.yml— a singledevservice with tmpfs/tmp, cross-platform (${HOME}${USERPROFILE}) dotfiles mount, and bridge network, plus one commented PostgreSQL example showing how to add auxiliary services behind Compose profiles. Targets Docker: builds viabuild:, with a note that Podman users may prefer building the image manually and usingimage:.Dockerfile— pinnedtypescript-node:5.0.1-24base, adds tmux, neovim, ripgrep, fd;ARG-based TZ/locale defaults (runtime values come fromlocalEnvforwarding)..env.example— the canonical reference for every value shared between the devcontainer files, documenting which values must match by convention (devcontainer.json can't read.env;${localEnv:*}reads host env vars). The dev service also loads.envviaenv_file(required: false), so its values are available inside the container at runtime..envis not committed — the installer generates it per project; without it, Compose falls back to sane defaults.Installer (
devmagic.run/install→setup/devmagic.sh)devcontainer.json,docker-compose.yml,Dockerfile,.env.example) into.devcontainer/in the current directory..devcontainer/.envwithCOMPOSE_PROJECT_NAMEset to the current folder name, sanitized to Compose naming rules. If sanitization changed the name, the installer automatically patchesworkspaceFolderin the downloadeddevcontainer.jsonto match.git add -f .devcontainerso.envsurvives common.env*ignore rules.Docs & website
docs/ARCHITECTURE.md: separation-of-concerns diagram, install flow (ASCII + Mermaid), scripts overview and file layout updated to the new design.www): simpler landing page — hero gains a one-line quick start (Docker + VS Code + "Reopen in Container"); the standalone/contribute cards and the redundant Quick Start section are gone (those workflows still live in Getting Started). Getting-started file tree shows all five files; prerequisites link Docker first (Podman as fallback); install-flow and dotfiles strings updated in both locales (en, pt-BR), avoiding literal{}in messages (ICU syntax in next-intl); unused strings removed.Test plan
bash -non the installer; compose YAML and devcontainer JSONC parse-checked.envgenerated with the folder name; auto-patch ofworkspaceFolderverified with a folder namedMy Weird Appgit check-ignoreconfirms.devcontainer/.env.exampleis committable while.envstays ignoredpnpm run buildpasses inwww;/,/features,/getting-started,/docs/architecturerendered in both locales (200s, new strings present)curl -fsSL https://devmagic.run/install | bash(post-merge, oncemainserves the new script) and "Reopen in Container"Notes
env_filewithrequired: falseneeds Docker Compose ≥ 2.24 (Jan 2024)..devcontainer/devcontainers/alpine/is left untouched as an alternative.🤖 Generated with Claude Code
https://claude.ai/code/session_01LuKjgTCp3QuvUWqxPf7Q1y