This is a quickly updated version of the startup portion from https://docs.docker.com/samples/rails/
There has been confusion using the sample provided by docker-compose, so I resolved to provide an easy-to-use skeleton that can be quickly booted up. The two main items I edited was bumping the Rails version to 6 and making the Dockerfile expecting the its directory to also be the Rails directory.
- Clone this repo
- Run
docker-compose run --no-deps web rails new . --force --database=postgresql
within the directory. (This will setup Rails) - Run
docker-compose run --no-deps web chown -R 1000:1000 *
(This will reset the permissioning on the generated files so you can work on them locally) - Run
docker-compose build web
(This will ensure that everything is appropriate built off the Rails-generated Gemfile - Run
docker-compose up
(to start the service!)
Be advised that some of these commands can take 3-7 minutes, depending on your system.