Rails, Docker and Webpacker is an awesome combination, for instance to develop React/Rails apps with. This demo app uses Rails 6, Webpacker and Docker. In development mode, it uses webpack-dev-server for live Javascript reloading. As database it uses PostgreSQL.
Read the blog post with background info about his repository at Running a Rails app with Webpacker and Docker
docker-compose build
docker-compose run web scripts/wait-for-it.sh db:5432 -- "rails db:create db:migrate"
docker-compose up
Now open http://localhost:3000 and look at your Javascript console to see messages
docker-compose exec web bash
You will need these 2 files for the asset pipeline for the production build.
First enter the web container as highlighed above. Then run:
run EDITOR=vim rails credentials:edit
exit and save via :wq
docker build -t docker-rails-demo .
Released under the MIT License