burakozturk / microservices-with-cloud-tools

Hybrid (docker & host) development environment for Windows & Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Microservices with Cloud Tools - Hybrid Environment

Technologies

Purpose

The host networking driver only works on Linux hosts, and is not supported on Docker Desktop for Windows. To achieve inter-service communication between host network and docker network we need to setup a hybrid development environment for microservices with cloud tools.

Scenario

  • Run some services with docker-compose
  • Run config-server and run/debug one or more services on your IDE.
  • All services automatically join consul catalog and are dynamically configured on traefik.
  • Handles inter-service communication via opeinfeign & service discovery

Usage

To use this environment you need access privileges;

  • docker network to host network by ip
  • host network to docker network by ip
Windows:

By default, host can not access containers' ip addresses on Windows platform.

Alter route table with:

route /P add  172.24.0.0 MASK 255.255.0.0 10.0.75.2
Linux:

By default, containers can not access host ip address on Linux platform.

Access to host from docker network (Linux/RedHat)

firewall-cmd --permanent --zone=public --add-rich-rule='rule family=ipv4 source address=172.24.0.0/16 accept' 
firewall-cmd --reload

Or, you can add route definition.

Build

mvn clean install 

Dockerize

mvn jib:dockerBuild

Run & Stop

cd ./docker-compose
docker-compose up 
docker-compose down --remove-orphans

Spring Boot Admin

http://localhost/admin-server

Swagger

http://localhost/city-service/swagger-ui.html

http://localhost/country-service/swagger-ui.html

About

Hybrid (docker & host) development environment for Windows & Linux


Languages

Language:Java 100.0%