Docker image size
$ docker images
REPOSITORY TAG SIZE
blitz_web latest 390MB
- Clone & Create
git clone git@github.com:zazk/Rails-6-Docker-Alpine.gitCreate a new Rails application under the repository directory
cd Rails-6-Docker-Alpine
rails new . --webpack --database=postgresql- Configure:
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: postgresRemove check Yarn
# ./config/environments/development.rb
# Disable Yarn Check
config.webpacker.check_yarn_integrity = false- Build the project:
docker-compose build- Create the database and run the migrations:
docker-compose run --rm web bin/rails db:create
docker-compose run --rm web bin/rails db:migrate- Run the app:
docker-compose upVisit your application
http://localhost:3000
- If you have probles with
pggem you should install Postgres before. On Macbrew install postgres - Ruby Version
2.5.3