Skip to content

zazk/Rails-6-Docker-Alpine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rails 6 Docker Alpine

Docker image size

$ docker images
REPOSITORY                                 TAG                       SIZE
blitz_web                                  latest                    390MB

Steps

  1. Clone & Create
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
  1. 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: postgres

Remove check Yarn

# ./config/environments/development.rb
# Disable Yarn Check
config.webpacker.check_yarn_integrity = false
  1. Build the project:
docker-compose build
  1. 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
  1. Run the app:
docker-compose up

Visit your application

http://localhost:3000

Troubleshooting

  1. If you have probles with pg gem you should install Postgres before. On Mac brew install postgres
  2. Ruby Version 2.5.3

About

Lightweight Rails 6 App over Docker Alpine images

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published