{"id":19389037,"url":"https://github.com/ryanwi/rails7-on-docker","last_synced_at":"2025-05-16T05:03:51.748Z","repository":{"id":36971863,"uuid":"410659960","full_name":"ryanwi/rails7-on-docker","owner":"ryanwi","description":"Working Rails 7 demo application running in Docker. No node.js or webpack required.","archived":false,"fork":false,"pushed_at":"2025-05-15T11:53:07.000Z","size":661,"stargazers_count":299,"open_issues_count":26,"forks_count":110,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-16T05:02:11.962Z","etag":null,"topics":["docker","github-actions","rails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/ryanwi.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,"zenodo":null}},"created_at":"2021-09-26T20:52:15.000Z","updated_at":"2025-04-06T19:23:38.000Z","dependencies_parsed_at":"2024-05-19T17:42:37.632Z","dependency_job_id":"856c91aa-8c97-4690-b2fa-b46392231309","html_url":"https://github.com/ryanwi/rails7-on-docker","commit_stats":{"total_commits":745,"total_committers":7,"mean_commits":"106.42857142857143","dds":0.553020134228188,"last_synced_commit":"9667f524083df9f23609189ea0c734bbdaca3f2f"},"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanwi%2Frails7-on-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanwi%2Frails7-on-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanwi%2Frails7-on-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanwi%2Frails7-on-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanwi","download_url":"https://codeload.github.com/ryanwi/rails7-on-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471062,"owners_count":22076585,"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","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":["docker","github-actions","rails"],"created_at":"2024-11-10T10:14:33.052Z","updated_at":"2025-05-16T05:03:51.707Z","avatar_url":"https://github.com/ryanwi.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/ryanwi/rails7-on-docker/actions/workflows/ci.yml/badge.svg)](https://github.com/ryanwi/rails7-on-docker/actions/workflows/ci.yml)\n[![Docker](https://github.com/ryanwi/rails7-on-docker/actions/workflows/docker.yml/badge.svg)](https://github.com/ryanwi/rails7-on-docker/actions/workflows/docker.yml)\n\nStart here: https://github.com/ryanwi/rails7-on-docker/generate\n\n# Rails 7 on Docker demo application\n\nThis app demonstrates Rails 7 with PostgreSQL, import maps, turbo, stimulus and hotwire, all running in Docker.\n\n**NOTE:** There are also examples Rails 8 and Rails 6 applications working in Docker\n\n* [Rails 8 Applicaiton Docker Template](https://github.com/ryanwi/rails8-on-docker)\n* [Rails 7 Applicaiton Docker Template](https://github.com/ryanwi/rails7-on-docker)\n* [Rails 6 Application Docker Template](https://github.com/ryanwi/rails-on-docker)\n\n## Features\n\n* Rails 7\n* Ruby 3.3\n* Dockerfile and Docker Compose configuration\n* PostgreSQL database\n* Redis\n* GitHub Actions for \n  * tests\n  * Rubocop for linting\n  * Security checks with [Brakeman](https://github.com/presidentbeef/brakeman) and [bundler-audit](https://github.com/rubysec/bundler-audit)\n  * Building and testing of a production Docker image\n* Dependabot for automated updates\n\n## Requirements\n\nPlease ensure you are using Docker Compose V2. This project relies on the `docker compose` command, not the previous `docker-compose` standalone program.\n\nhttps://docs.docker.com/compose/#compose-v2-and-the-new-docker-compose-command\n\nCheck your docker compose version with:\n```\n% docker compose version\nDocker Compose version v2.10.2\n```\n\n## Initial setup\n```\ncp .env.example .env\ndocker compose build\ndocker compose run --rm web bin/rails db:setup\n```\n\n## Running the Rails app\n```\ndocker compose up\n```\n\n## Running the Rails console\nWhen the app is already running with `docker-compose` up, attach to the container:\n```\ndocker compose exec web bin/rails c\n```\n\nWhen no container running yet, start up a new one:\n```\ndocker compose run --rm web bin/rails c\n```\n\n## Running tests\n```\ndocker compose run --rm web bin/rspec\n```\n\n## Updating gems\n```\ndocker compose run --rm web bundle update\ndocker compose up --build\n```\n\n## Production build\n\n(adjust tags as needed)\n\n### with [BuildKit](https://docs.docker.com/build/buildkit/)\n```\nDOCKER_BUILDKIT=1 docker build --tag rails-on-docker --load .\n```\n\nTest the image can be used and Rails starts up, use a fake key for testing purposes only:\n```\ndocker run --rm --env SECRET_KEY_BASE=dummy rails-on-docker\n```\n\n### With legacy builder (no BuildKit)\n```\ndocker build --tag rails-on-docker .\n```\n\nTest the image can be used and Rails starts up, use a fake key for testing purposes only:\n```\ndocker run --rm --env SECRET_KEY_BASE=dummy rails-on-docker\n```\n\n## Deployment\n\nThis app can be hosted wherever Ruby is supported and PostgreSQL databases can be provisioned.\n\n#### Render\n\n[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/ryanwi/rails7-on-docker)\n\nNOTE: You will need to generate a production secret with `bin/rails secret` and set it as the `SECRET_KEY_BASE` environment variable.\n\n## Credits/References\n\n### Rails with Docker\n* [Quickstart: Compose and Rails](https://github.com/docker/awesome-compose/tree/master/official-documentation-samples/rails/)\n* [Docker Rails Samples](https://docs.docker.com/samples/rails/)\n* [Docker for Rails Developers\nBuild, Ship, and Run Your Applications Everywhere](https://pragprog.com/titles/ridocker/docker-for-rails-developers/)\n* [Ruby on Whales:\nDockerizing Ruby and Rails development](https://evilmartians.com/chronicles/ruby-on-whales-docker-for-ruby-rails-development)\n* [Rails generator to produce Dockerfiles and related files](https://github.com/rubys/dockerfile-rails)\n* [docker init](https://docs.docker.com/engine/reference/commandline/init/)\n* [Rails 7.1 Dockerfile Generator Template](https://github.com/rails/rails/blob/main/railties/lib/rails/generators/rails/app/templates/Dockerfile.tt)\n\n### Rails 7 with importmaps \n\n* [Alpha preview: Modern JavaScript in Rails 7 without Webpack](https://www.youtube.com/watch?v=PtxZvFnL2i0)\n\n### Rails 7 with hotwire\n\n* [Stimulus 3 + Turbo 7 = Hotwire 1.0](https://world.hey.com/dhh/stimulus-3-turbo-7-hotwire-1-0-9d507133)\n* [Turbo 7](https://world.hey.com/hotwired/turbo-7-0dd7a27f)\n* [Rails 7 will have three great answers to JavaScript in 2021+](https://world.hey.com/dhh/rails-7-will-have-three-great-answers-to-javascript-in-2021-8d68191b)\n* [Hotwire Turbo Replacing Rails UJS](https://www.driftingruby.com/episodes/hotwire-turbo-replacing-rails-ujs)\n\n## Author\n\n**Ryan Williams**\n\n- \u003chttps://www.ryanwilliams.dev\u003e\n- \u003chttps://bsky.app/profile/ryanwi.bsky.social\u003e\n- \u003chttps://hachyderm.io/@ryanwi\u003e\n- \u003chttps://github.com/ryanwi\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanwi%2Frails7-on-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanwi%2Frails7-on-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanwi%2Frails7-on-docker/lists"}