Docker image size
$ docker images
REPOSITORY TAG SIZE
blitz_web latest 390MB
git clone [email protected]:zazk/Rails-6-Docker-Alpine.git
Create a new Rails application under the repository directory
cd Rails-6-Docker-Alpine
rails new . --webpack --database=postgresql
Modify your database configuration to use the postgresql container configuration:
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: db
username: postgres
Remove check Yarn
# ./config/environments/development.rb
# Disable Yarn Check
config.webpacker.check_yarn_integrity = false
docker-compose build
docker-compose run --rm web bin/rails db:create
docker-compose run --rm web bin/rails db:migrate
docker-compose up
Visit your application
http://localhost:3000
pg
gem you should install Postgres before. On Mac brew install postgres
2.5.3