{"id":16108675,"url":"https://github.com/aliosm/ruby-on-rails-devcontainer","last_synced_at":"2025-08-10T08:05:59.847Z","repository":{"id":161463665,"uuid":"636153434","full_name":"AliOsm/ruby-on-rails-devcontainer","owner":"AliOsm","description":"Ruby on Rails devcontainer setup that includes Ruby, Ruby on Rails, Selenium, PostgreSQL, Redis, MeiliSearch, and Memcached","archived":false,"fork":false,"pushed_at":"2024-07-28T17:22:27.000Z","size":28,"stargazers_count":23,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T04:35:13.694Z","etag":null,"topics":["devcontainer","meilisearch","memcached","postgresql","redis","ruby","ruby-on-rails","selenium","vscode"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AliOsm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-04T08:31:34.000Z","updated_at":"2025-06-07T18:42:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"775b0d12-dd6c-47cd-adfe-79831a1267c7","html_url":"https://github.com/AliOsm/ruby-on-rails-devcontainer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AliOsm/ruby-on-rails-devcontainer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliOsm%2Fruby-on-rails-devcontainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliOsm%2Fruby-on-rails-devcontainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliOsm%2Fruby-on-rails-devcontainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliOsm%2Fruby-on-rails-devcontainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AliOsm","download_url":"https://codeload.github.com/AliOsm/ruby-on-rails-devcontainer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliOsm%2Fruby-on-rails-devcontainer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269693593,"owners_count":24460248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["devcontainer","meilisearch","memcached","postgresql","redis","ruby","ruby-on-rails","selenium","vscode"],"created_at":"2024-10-09T19:27:46.886Z","updated_at":"2025-08-10T08:05:59.823Z","avatar_url":"https://github.com/AliOsm.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby on Rails DevContainer\nRuby on Rails DevContainer setup that includes Ruby, Ruby on Rails, Selenium, PostgreSQL, Redis, Memcached, and MeiliSearch.\n\n## Pre-requisits\n\n- [VSCode](https://code.visualstudio.com)\n- [Docker](https://www.docker.com)\n\n## What are we setting up in this DevContainer?\n\nSoftwares:\n- [Ruby](https://www.ruby-lang.org) version `3.3.4`\n- [NodeJS](https://nodejs.org) version `20.15.0` (or later)\n- [Yarn](https://yarnpkg.com) version `1.22.22` (or later)\n- [Zsh](https://www.zsh.org)\n- [Git](https://git-scm.com)\n- [Vim](https://www.vim.org)\n- [Selenium](https://www.selenium.dev)\n- [PostgreSQL](https://www.postgresql.org)\n- [Redis](https://redis.io)\n- [Memcached](https://memcached.org)\n- [MeiliSearch](https://www.meilisearch.com)\n\nExtensions:\n- [Postman](https://marketplace.visualstudio.com/items?itemName=Postman.postman-for-vscode)\n- [Rails DB Schema](https://marketplace.visualstudio.com/items?itemName=aki77.rails-db-schema)\n- [Rails I18n](https://marketplace.visualstudio.com/items?itemName=aki77.rails-i18n)\n- [Rails Partial](https://marketplace.visualstudio.com/items?itemName=aki77.rails-partial)\n- [Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)\n- [vscode-gemfile](https://marketplace.visualstudio.com/items?itemName=bung87.vscode-gemfile)\n- [GitLens — Git supercharged](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens)\n- [Ruby ERB::Formatter](https://marketplace.visualstudio.com/items?itemName=elia.erb-formatter)\n- [Run on Save](https://marketplace.visualstudio.com/items?itemName=emeraldwalk.RunOnSave)\n- [ERB Linter](https://marketplace.visualstudio.com/items?itemName=manuelpuyol.erb-linter)\n- [Stimulus LSP](https://marketplace.visualstudio.com/items?itemName=marcoroth.stimulus-lsp)\n- [Live Preview](https://marketplace.visualstudio.com/items?itemName=ms-vscode.live-server)\n- [SQLTools](https://marketplace.visualstudio.com/items?itemName=mtxr.sqltools)\n- [SQLTools PostgreSQL/Cockroach Driver](https://marketplace.visualstudio.com/items?itemName=mtxr.sqltools-driver-pg)\n- [vscode-icons](https://marketplace.visualstudio.com/items?itemName=vscode-icons-team.vscode-icons)\n- [Git Blame](https://marketplace.visualstudio.com/items?itemName=waderyan.gitblame)\n- [Shopify LSP](https://marketplace.visualstudio.com/items?itemName=Shopify.ruby-lsp)\n\n## How to use?\n\nCopy the `.devcontainer` directory into your Ruby on Rails project root directory and open it inside VSCode, then you will be able to use devcontainers as documented [here](https://code.visualstudio.com/docs/devcontainers/tutorial).\n\n## Things to be aware of\n\n### Automatic setup\n\nThis DevContainer setup does the following for you while building the image:\n- Runs `gem update --system`\n- Runs `bundle`\n- Runs `yarn`\n- Runs `rails db:create db:migrate db:seed`\n\nYou can customize this behavior inside `.devcontainer/setup.sh` file.\n\n### Formatting\n\nThis DevContainer setup assumes that you are using `erb-lint`, `erb-formatter`, and `i18n-tasks` gems, as it sets up formatting commands using `Run on Save` VSCode extension to format `erb`, `css`, and `yml` files. See [devcontainer.json](./.devcontainer/devcontainer.json) lines 83-106 for more details.\n\n### PostgreSQL\n\nYou need to set the `host` and `port` properties for your development and testing databases in `config/database.yml` like this:\n\n```yml\ndevelopment:\n  \u003c\u003c: *default\n  database: ror_project_development\n\n  username: postgres\n  password: postgres\n  host: db\n  port: 5432\n\ntest:\n  \u003c\u003c: *default\n  database: ror_project_test\n\n  username: postgres\n  password: postgres\n  host: db\n  port: 5432\n```\n\nThis is required because the docker service for PostgreSQL is named `db` inside `.devcontainer/docker-compose.yml`, and you should access it by its name.\n\nIf you changed the `username` and/or `password` inside `config/database.yml`, then you will need to change them inside `.devcontainer/devcontainer.json` file to get `sqltools` extensions works properly.\n\n### Redis\n\nTo connect to Redis in the development environment, you need to instantiate the connection like this:\n\n```ruby\nredis = Redis.new(url: ENV['REDIS_URL'] || 'http://redis:6379')\n```\n\nYou should define `REDIS_URL` in your production environment, while in development `redis://redis:6379` will be used. This is required because the docker service for Redis is named `redis` inside `.devcontainer/docker-compose.yml`, and you should access it by its name.\n\n### Memcached\n\nMake sure to change `config.cache_store = :memory_store` to `config.cache_store = :mem_cache_store` inside `config/environments/development.rb`. Also, you will need to enable caching in development by running `rails dev:cache` command.\n\nNo need to specify the Memcached server as it is already defined inside `.devcontainer/Dockerfile` like this `ENV MEMCACHE_SERVERS=memcached:11211`.\n\n### MeiliSearch\n\nInside your `config/initializers/meilisearch.rb` initializer, make sure to set the `meilisearch_url` and `meilisearch_api_key` properties like this:\n\n```ruby\nMeiliSearch::Rails.configuration = {\n  meilisearch_url: ENV['MEILISEARCH_HOST'] || 'http://meilisearch:7700',\n  meilisearch_api_key: ENV['MEILISEARCH_KEY'] || 'LOCAL_TEST_KEY'\n}\n```\n\nYou should define `MEILISEARCH_HOST` and `MEILISEARCH_KEY` in your production environment, while in development `http://meilisearch:7700` and `LOCAL_TEST_KEY` will be used. This is required because the docker service for MeiliSearch is named `meilisearch` inside `.devcontainer/docker-compose.yml`, and you should access it by its name.\n\nIf you changed the `meilisearch_api_key` to something different than `LOCAL_TEST_KEY`, make sure to update `.devcontainer/docker-compose.yml` also.\n\n## Notes\n\n- This is just a development setup, make sure to setup these services in your production environment also if you are using them\n- Rebuild your DevContainer image when you change any file inside `.devcontainer` directory\n- Take a look at the installed extensions and modify the list as required\n- This could be used in GitHub Codespaces easily with a single click\n- Feel free to submit any change you feel it is benefitial to this repo :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliosm%2Fruby-on-rails-devcontainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliosm%2Fruby-on-rails-devcontainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliosm%2Fruby-on-rails-devcontainer/lists"}