Skip to content

AroneyS/zoo-stats-api-graphql

 
 

Repository files navigation

Zoo stats

Build Status

Setup Docker and Docker Compose

Usage

  1. Clone the repository git clone https://github.com/zooniverse/zoo_stats_api_graphql.

  2. Install Docker from the appropriate link above.

  3. cd into the cloned folder.

  4. Run docker-compose build to build the containers Panoptes API container. You will need to re-run this command on any changes to Dockerfile

  5. Install the gem dependencies for the application

    • Run: docker-compose run --rm --entrypoint="bundle install" zoo_stats
  6. Create and run the application containers with docker-compose up

  7. If the above step reports a missing database error, kill the docker-compose process or open a new terminal window in the current directory and then run docker-compose run --rm --entrypoint="bundle exec rake db:setup" zoo_stats to setup the database. This command will launch a new Docker container, run the rake DB setup task, and then clean up the container.

  8. Open up the application in your browser at http://localhost:3000

Once all the above steps complete you will have a working copy of the checked out code base. Keep your code up to date and rebuild the image on any code or configuration changes.

Testing

  1. Setup the test environment and database

    • Run: docker-compose run --rm -e RAILS_ENV=test --entrypoint="bundle install" zoo_stats
    • Run: docker-compose run --rm -e RAILS_ENV=test --entrypoint="bundle exec rake db:setup" zoo_stats
  2. Run the tests

    • Run: docker-compose run -T --rm -e RAILS_ENV=test --entrypoint="bundle exec rspec" zoo_stats

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 86.6%
  • Shell 7.3%
  • Python 5.3%
  • Other 0.8%