An opinionated Rails template for starting new Rails projects
Read the introductory blog post about this Rails application template.
As Rails developers, we create new Rails projects all the time. Each time, we need to bootstrap and set up the project so that we can reliably and efficiently begin working on them.
One of the major sources of inefficiency is setting up a cross platform Rails development environment.
This Rails template aims to solve that problem by containerizing a Rails application and adding a development environment that works (almost) anywhere Docker works.
- Docker and
docker-compose
(typically installed via Docker Desktop) - Requires Rails 7.0.x and above
Run rails new your-app --skip-bundle --database=postgresql -m https://raw.githubusercontent.com/Code-With-Rails/rails-template/main/default.rb
Replace your-app
with the name of your application.
Instead of bin/rails server
, you can run docker-compose up
Run docker-compose run app bash
. This will drop you into the container where the app is located.
Note that you should run docker-compose up
in a separate terminal window so that the database and all related services are booted up already.
Feel free to fork this and create pull requests. We adhere to the Code of Conduct as described for participation on GitHub. Please be nice to one another.
This code is released under the MIT License.