This is a minimal setup to start a new Rails project
Assumptions:
- Postgresql as a database
- Webpacker as asset manager
- Stimulusjs as js framework
Use the Dockerfile
to build the rails image
docker-compose build
Run rails new
command inside the container you just created
docker-compose run app rails new . --force --webapck=stimulus --database=postgresql
Start the db and rails images
docker-compose up
On a different console, copy the db config with username, and create the db:
cp database.sample.yml config/database.yml
docker-compose run app rails db:create
Now you can visit http://localhost:3000 and see your pristine rails 6 up & running