Requirements
Banking comes with a docker-compose file which will allow you to run everything locally without the need to install the dependencies. There are however, a few tasks that need to be run in order to set up the database.
Setup
docker-compose up -d
docker-compose run web rake db:create
docker-compose run web rake db:migrate
This will boot up several docker containers. An overview of the containers
An overview of what each of these does:
Container | Description |
---|---|
db | Runs a PostgreSQL database |
web | Runs a Ruby on Rails application, this is the API |
rabbitmq | Runs RabbitMQ server |
redis | Runs a redis service |
sneakers | Runs several workers, consumes/produces messages on rabbitmq and queues on redis |
kafka_consumer | Consumes messages from kafka |
Note on Kafka
Kafka itself is not part of the docker-compose file. You will need to run Kafka independantly. The kafka_consumer container will attempt to connect to kafka on the host machine.
Kafka
To start kafka you can clone the following repo
git clone git@github.com:wurstmeister/kafka-docker.git
vim docker-compose-single-broker.yml
Replace as followes:
KAFKA_ADVERTISED_HOST_NAME: 192.168.99.100
set to:
KAFKA_ADVERTISED_HOST_NAME: 127.0.0.01
docker-compose -f docker-compose-single-broker.yml up -d
To test that it is up, telnet 127.0.0.1 9092
You can start the kafka_consumer by running
docker-compose up -d kafka_consumer
Websockets
wsc -er ws://localhost:3099/cable?token=234789234789234789