Create the directory that will contain your project:
mkdir my-new-app
cd my-new-app
Create 3 blank files:
touch Dockerfile
touch docker-compose.yml
touch entrypoint.sh
Then copy/paste the corresponding files below.
docker-compose build
docker-compose run web bash
# you're now running a bash terminal inside the container
gem install rails
rails new .
exit
# you're now out of the container
In config/webpacker.yml
replace the key development/dev_server/host
with the value 0.0.0.0
(localhost
is the default value and we don't want it).
echo "/docker" >> .gitignore
echo "/bundle" >> .gitignore
docker-compose up