odin-kittens

Stars
1
Committers
1

README

Practice working with APIs. Guidance provided by: TheOdinProject working with APIs

Ruby version

2.6.2

System dependencies

  • Docker-ce
  • Docker-compose
  • Rails 5.2.3

Getting started

# builds the image
docker-compose build

# create the database
docker-compose run web rails db:create
docker-compose run web rails db:migrate

# runs the server locally on port 3000
docker-compose up

# runs the test suite
docker-compose run --rm web rails test
docker-compose exec web rails test # Only works if container is 'up'

# run a pry session
docker-compose run web rails console
docker-compose exec web rails console


# turns the container off
docker-compose down

Important notes

docker-compose exec web <command> 

Will only work with an active containers

docker-compose run --rm web rails test

Will spin up a new container, run rails test, and then remove the container when finished

Viewing the project

docker-compose build # if you didnt run it already
docker-compose up # equivalent to a 'rails server'

View the project in the browser @ http://localhost:3000

Testing the project

docker-compose build # if not previously run
docker-compose run --rm web rails test
# or
docker-compose build # if not previously run
docker-compose up
docker-compose exec web rails test