This project is based on Phusion's Baseimage-docker image, and the Brightbox-ng package.
It installs Ruby 2.4 and Rails 5.1.2 on the docker container, and sets up a "webuser" user to run the application (instead of root)
- Docker
- Docker Compose
docker-compose build
docker-compose run web rails new . --force --database=postgresql
default: &default
adapter: postgresql
encoding: unicode
host: db
username: postgres
password:
pool: 5
development:
<<: *default
database: myapp_development
test:
<<: *default
database: myapp_test
Since rails new
has updated the Gemfile, we need to rebuild the docker image:
docker-compose build
docker-compose up
# Create database
docker-compose run webapp rake db:create
# Migrate database
docker-compose run webapp rake db:migrate
# Stop the application
docker-compose down