Microservices Reddit

This project allows you to deploy the Reddit application in docker containers on your machine.
Your data will be stored on "reddit_db" volume.
Read about the installation of Docker here.

Run application with Docker Compose

Install Docker Compose

Rename env.example to .env:

cp env.example .env

Edit .env with your data.

This command will start four containers with Reddit application and five with monitoring system:

docker-compose up -d

Stop application:

docker-compose down

Run application with Swarm in Google Cloud Platform

Install Docker Machine
The script uses the Google Compute Engine Driver.

Copy the template:

cp create-docker-machine4swarm.sh.example create-docker-machine4swarm.sh

Configure the script create-machine4swarm.sh. You have to set project name.

Run the script to create the cluster using Docker Swarm:

bash create-docker-machine4swarm.sh

Use application

Enter in browser http://<your-machine>:9292/ and enjoy.

Monitoring services with Grafana

http://<your-machine>:3000

Monitoring services with Prometheus

Enter in browser http://<your-machine>:9090/.

Metrics:

  • ui_health
  • ui_health_comment_availability
  • ui_health_post_availability
  • comment_health
  • comment_health_mongo_availability

Monitoring docker containers with cAdvisor

http://<your-machine>:8080

Build containers youself

Docker images are on the docker hub. But if you want to collect them yourself, then do the following.

Container with UI application:

cd ui
bash docker_build.sh

Container with Comment application:

cd comment
bash docker_build.sh

Container with Post application:

cd post-py
bash docker_build.sh

Container with Prometheus:

cd prometheus
bash docker_build.sh

Container with Alertmanager:

cd alertmanager
bash docker_build.sh

Deploy Reddit application in GKE

Read this