mirror of
https://gitee.com/ShopeX/ECShopX
synced 2026-08-06 03:56:24 +08:00
TDD Guard Development Container
A consistent, isolated environment for developing TDD Guard.
Features
- Network isolation for security
- Automated development environment setup
- Pre-configured development tools
- Persistent command history
What's Inside
| Component | Purpose |
|---|---|
| Node.js 22 | Main CLI & Vitest/Jest/Storybook reporters |
| Python 3.11 + pipx | Pytest reporter |
| PHP 8.2 + Composer | PHPUnit reporter |
| Go 1.24 | Go reporter |
| Rust 1.89 | Rust reporter with cargo-nextest |
| Ruby 3.x + Bundler | RSpec reporter |
| Playwright deps | Browser automation for Storybook test-runner |
| Claude Code | AI assistance |
| Dev tools | Git, zsh, fzf, Docker, gh, vim, nano, git-delta |
Key files:
Dockerfile- Container definitiondevcontainer.json- IDE configurationscripts/- Setup and configuration scriptsinit-firewall.sh- Network securitysetup-dev-environment.sh- Main setup orchestrator
Prerequisites
Choose one of:
- Docker Desktop (macOS/Windows/Linux)
- Colima (macOS)
Quick Start
VS Code
- Install Dev Containers extension
- Open project → Click green button (bottom-left) → "Reopen in Container"
- Wait for build → Start coding
Learn more about VS Code Dev Containers →
IntelliJ IDEA
- File → Remote Development → Dev Containers → New Dev Container → From Local Project
- Select Docker/Colima connection
- Browse to
<project>/.devcontainer/devcontainer.json - Build Container and Continue
Resources:
Tips & Troubleshooting
Colima Setup
IntelliJ requires more resources than the default:
# Basic setup
colima start --cpu 2 --memory 4
# With performance optimization
colima start --cpu 4 --memory 8 --vm-type vz --mount-type virtiofs
macOS Performance
For better file performance:
- Docker Desktop: Enable VirtioFS in Settings → General → Choose file sharing implementation
- Colima: Use
--vm-type vz --mount-type virtiofsflag when starting (see above)
Common Commands
npm test # Run all tests
npm run test:unit # Run unit tests only
npm run test:reporters # Run reporter tests
npm run checks # Run all quality checks (typecheck, lint, format, test)
Additional Notes
- Command history is preserved between container sessions in a persistent volume
- Network isolation restricts outbound connections for security (see
scripts/init-firewall.shfor allowed services) - Environment variables like
NODE_OPTIONSandUSE_SYSTEM_CLAUDEare pre-configured - Timezone defaults to Europe/Stockholm but can be changed via
TZbuild arg