Systems build docker image
241
This is an API that serves ticks. This project consists of two main pieces:
Sidekiq powered background worker that reads and writes a Redis instanceYou should have the Ruby version listed in Gemfile installed.
You should have the latest version of Postgres 9.x installed.
Redis is required. To install and start:
$ brew install redis
$ redis-server /usr/local/etc/redis.conf (needs to be running for tests to pass)
You will also require the foreman and bundler gems:
$ gem install bundler
$ gem install foreman
Install dependencies:
$ foreman run bundle install
Create a test and a development database:
$ psql
psql$ CREATE DATABASE my_api_development;
psql$ CREATE DATABASE my_api_test;
Copy .env_example to .env and fill out all values - ensure you include the
URLs for the development and test databases you just created.
Now run database migrations:
$ foreman run bundle exec db:migrate
$ foreman run bundle exec db:migrate RACK_ENV=test
To start the server:
$ foreman start
This command starts the api server and the background worker application.
GET /ticks: Show number of ticks been processed by the serverPOST /ticks: Adds a new tick to the queue to be processed asynchronously. It will take 10 seconds for a tick to be processedThe 2 components that form this application should be deployed together. This repository SHOULD NOT be deployed if the tests are failing.
Content type
Image
Digest
Size
284.2 MB
Last updated
over 9 years ago
docker pull drubin/systems-engineer-challenge