Skip to content

This is a sample app showing how to dockerize Scala microservices in a monorepo.

License

Notifications You must be signed in to change notification settings

nebtrx/dockerized-example-services

Repository files navigation

dockerized-example-services

Build Status

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.

Development

This solution uses a pure FP approach, a bunch of streams, and some of the greatest libraries in the FP Scala ecosystem like:

  1. cats
  2. cats-effects
  3. fs2
  4. http4s
  5. fs2-rabbit

Try it out locally

Note: This project relies on having Docker installed on your system

  1. Clone this repo and cd into it
$ git clone git@github.com:nebtrx/dockerized-example-services.git

$ cd  dockerized-example-services
  1. Build the project and create the containers' images
$ sbt docker:publishLocal
  1. 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
  1. Create and start the containers
$ docker-compose up
  1. Check http://localhost:8080/stream on your browser and watch the magic take place

  2. Optionally, you can check http://localhost:15672 to access rabbitmq console

License

This project is licensed under the MIT License.

About

This is a sample app showing how to dockerize Scala microservices in a monorepo.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages