Networking

Internal Docker networking and service connectivity in Arya Banking.

Shared Platform Network

The Arya Banking platform relies on a single, shared Docker bridge network named arya-banking-net.

Role of arya-banking-net

  • Isolation: All platform containers are restricted to this network, preventing accidental exposure of internal services.
  • Service Discovery: Eureka and the Config Server use container hostnames (e.g., arya-banking-service-registry) to communicate within the bridge.
  • Inter-service Traffic: Non-public traffic (e.g., Kafka to microservices) flows entirely through this network.

Port Mapping Reference

The platform uses consistent port mapping (Host → Container) to maintain predictability during development.

ServiceHost PortContainer PortProtocolPurpose
api-gateway80858085HTTPPublic Ingress
user-service80868086HTTPMicroservice
auth-service80878087HTTPMicroservice
admin-service80898089HTTPMicroservice
config-server80908090HTTPProperty Server
service-registry87618761HTTPEureka Dashboard
keycloak54338080HTTPIAM console
vault80918200HTTPSecrets Engine
kafka90929092PLAINTEXTEvent Broker

Mixed Docker + Local Connectivity

When the platform stack (Service Registry, Config Server, API Gateway) runs in Docker but business services (User, Auth, Admin) run locally via Maven, the business services must register with Eureka using an address reachable from Docker containers. The shared config in arya-banking-configs sets:

Yaml code-highlight
eureka:
  instance:
    hostname: host.docker.internal

This ensures locally-run services advertise themselves as host.docker.internal:<port>, which the Docker gateway container can reach.

host.docker.internal resolves to the host machine from inside Docker containers. On Linux, add --add-host host.docker.internal:host-gateway to your Docker run command.

Traffic Flow

  1. North-South Traffic: Enters through Port 8085 (API Gateway) and is routed to individual services on 8086-8089.
  2. East-West Traffic: Inter-service Feign calls bypass the Gateway and communicate directly via container hostnames on their respective host ports (configured via Eureka).
Ensure that the arya-banking-net is created manually (make up handles this) before starting individual services directly via Maven.