-
Clone repo and rename new folder to project name [$ git clone repo-name folder-name]
-
(optional) Open project in editor and rename all instances of 'myapp' to the project name.
-
Create a new rails 7 app
$ docker-compose run --no-deps web rails new . --force --database=postgresql
-
Build the image
$ docker-compose build
-
Replace database.yml with this (but change myapp to the project name):
default: &default
adapter: postgresql
encoding: unicode
host: db
username: postgres
password: password
pool: 5
development:
<<: *default
database: myapp_development
test:
<<: *default
database: myapp_test
-
Start containers
$ docker-compose up
-
Create the database
$ docker-compose run web rake db:create