$ make all
That's all.
$ git clone https://github.com/tokidrill/docker-rails6-postgres.git
Create Rails project with PostgreSQL.
$ docker-compose run --rm web rails new . --force --no-deps --database=postgresql --skip-test --webpacker
$ make new
$ docker-compose build --no-cache
$ make build
config/database.yml
default: &default
adapter: postgresql
encoding: utf8
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
host: <%= ENV.fetch('DATABASE_HOST') {'db'} %>
port: <%= ENV.fetch('DATABASE_PORT') {'5432'} %>
username: <%= ENV.fetch('DATABASE_USER') {'postgres'} %>
password: <%= ENV.fetch('DATABASE_PASSWORD') {'password'} %>
development:
<<: *default
database: test_development
test:
<<: *default
database: test_test
production:
<<: *default
database: test_production
username: test
password: <%= ENV['TEST_DATABASE_PASSWORD'] %>
make copy-config
$ docker-compose run web rake db:create
$ docker-compose up -d
$ make up
Access http://localhost:3000 .
Congratulations !! Now, you're on Rails !!