This repo is a sample app showing how to dockerize Scala microservices in a monorepo.
The solution consists in a simple common
library containing shared type definitions,
a producer
service pulling status updates from Twitter and
pumping those, every one second, to a consumer
web app through Rabbit hole,
cough..I mean, queue. The web app renders the incoming status data in real time.
This solution uses a pure FP approach, a bunch of streams, and some of the greatest libraries in the FP Scala ecosystem like:
Note: This project relies on having Docker installed on your system
- Clone this repo and
cd
into it
$ git clone git@github.com:nebtrx/dockerized-example-services.git
$ cd dockerized-example-services
- Build the project and create the containers' images
$ sbt docker:publishLocal
- Copy the sample configuration file and edit it to match your configuration so your docker can pick up the env vars
$ cp .env.example .env
- Create and start the containers
$ docker-compose up
-
Check http://localhost:8080/stream on your browser and watch the magic take place
-
Optionally, you can check http://localhost:15672 to access
rabbitmq
console
This project is licensed under the MIT License.