- Clone this repo
- Install PostgreSQL in case you don't have it
- Run
bootstrap.sh
with the name of your your project like ./bootstrap.sh my_awesome_project
rspec
and make sure all tests pass
rails s
- You can now try your REST services!
- Have
docker
and docker-compose
installed (You can check this by doing docker -v
and docker-compose -v
)
- Modify the following lines in the
database.yml
file:
default: &default
adapter: postgresql
encoding: unicode
pool: 5
username: postgres
password: postgres
host: db
port: 5432
- Generate a secret key for the app by running
docker-compose run --rm --entrypoint="" web rake secret
, copy it and add it in your environment variables.
- Run
docker-compose run --rm --entrypoint="" web rails db:create db:migrate
.
- (Optional) Seed the database with an AdminUser for use with ActiveAdmin by running
docker-compose run --rm --entrypoint="" web rails db:seed
. The credentials for this user are: email: admin@example.com
; password: password
.
- (Optional) If you want to deny access to the database from outside of the
docker-compose
network, remove the ports
key in the docker-compose.yml
from the db
service.
- (Optional) Run the tests to make sure everything is working with:
docker-compose run --rm --entrypoint="" web rspec .
.
- Run the application with
docker-compose up
.
- You can now try your REST services!