A fully-featured development container configuration for Ruby on Rails projects with integrated tools and services.
- Pre-configured Ruby on Rails development environment
- Docker Compose setup with Selenium for system testing
- GitHub CLI, Node.js, Python, and AWS CLI pre-installed
- Automatic Ruby version synchronization
- MCP (Model Context Protocol) server integration
- Volume mounts for SSH, AWS, GitHub, and Claude configurations
- Docker Desktop or Docker Engine
- Visual Studio Code with Dev Containers extension
- Git
- In your Rails project directory, add this repository as a git subtree:
git subtree add --prefix=.devcontainer --squash git@github.com:douhashi/devcontainer-rails.git main
-
Open your Rails project in VS Code:
code . -
When prompted, click "Reopen in Container" or run the command "Dev Containers: Reopen in Container"
-
Wait for the container to build and post-create scripts to complete
-
Rebuild and start the development container:
.devcontainer/bin/rebuild .devcontainer/bin/up
-
The container will build and start with all configured services
To update the DevContainer configuration with the latest changes from the upstream repository:
git subtree pull --prefix=.devcontainer --squash git@github.com:douhashi/devcontainer-rails.git mainThe Ruby version is automatically synchronized from .tool-versions file. To change it:
- Update
.tool-versionsin your Rails project - Run
sync-ruby-version.shto update the DevContainer configuration - Rebuild the container
- App: Main Rails application container (ports 5100, 3036)
- Selenium: Chrome browser for system tests (port 4444)
KAMAL_REGISTRY_USERNAME: Docker registry username for Kamal deploymentsKAMAL_REGISTRY_PASSWORD: Docker registry password for Kamal deploymentsVITE_RUBY_HOST: Vite development server host (default: 0.0.0.0)SELENIUM_URL: Selenium server URL for system tests
post-create.sh: Runs after container creation (installs packages, tools, Rails setup)post-attach.sh: Runs each time you attach to the containersync-ruby-version.sh: Updates DevContainer Ruby version from .tool-versions
This project is licensed under the MIT License - see the LICENSE file for details.