Configuration Reference

Application properties, environment variables, and Docker settings for the Service Registry.

Application Configuration (application.yaml)

The Eureka server requires specific properties to operate in standalone mode (preventing it from trying to register with itself).

> Yaml code-highlight
server:
  port: 8761

eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka
    register-with-eureka: false   # Critical for standalone mode
    fetch-registry: false         # Saves memory, prevents self-loop

spring:
  application:
    name: arya-banking-service-registry

Cluster Readiness: Currently configured for single-node standalone mode. To run a clustered Eureka pair, add a second Spring profile with each node's defaultZone pointing to the other node's URL and set register-with-eureka: true.


Platform Stack Integration

When running as part of the full platform stack via arya-banking-infra/compose/platform.yml, the Service Registry is the first container to start. The Config Server and API Gateway depend on it.

> Yaml code-highlight
# From compose/platform.yml
service-registry:
  image: karthikulkarni/arya-banking-service-registry:latest
  container_name: service-registry
  ports:
    - "8761:8761"
  networks:
    - arya-banking-net

Refer to the Infrastructure → Docker Compose page for the complete platform.yml configuration.


Environment Variables

When running via Docker Compose or in production, you can override default settings using environment variables.

VariableDefault & Purpose
SERVER_PORT8761 — Overrides server.port at runtime
SPRING_PROFILES_ACTIVEdefault — Activates a named Spring profile
JAVA_OPTS(empty) — Pass JVM memory flags e.g. -Xms256m -Xmx512m
EUREKA_CLIENT_SERVICEURL_DEFAULTZONEhttp://localhost:8761/eureka — Peer URL in cluster mode

Dockerfile Build Stages

The Service Registry uses a multi-stage Dockerfile to minimize the runtime footprint.

Uses maven:3.9.4-eclipse-temurin-17. Downloads dependencies via pom.xml layer caching, then copies src/ and runs mvn -B -DskipTests package to generate the fat JAR.


Docker Build

Dockerfile

> Dockerfile code-highlight
# Stage 1 — Build
FROM maven:3.9.4-eclipse-temurin-17 AS build
WORKDIR /workspace
COPY pom.xml .
RUN mvn -B dependency:go-offline
COPY src ./src
RUN mvn -B -DskipTests clean package

# Stage 2 — Runtime
FROM eclipse-temurin:17-jre-jammy
COPY --from=build /workspace/target/*.jar /app/app.jar
EXPOSE 8080
ENTRYPOINT ["java","-jar","/app/app.jar"]

Port discrepancy — the Dockerfile exposes 8080 while the application actually runs on 8761 (server.port: 8761 in application.yaml). The compose mapping compensates by mapping 8761:8761 and setting SERVER_PORT=8761, but the EXPOSE 8080 instruction should be corrected to 8761.

Standalone docker-compose.yml

The registry repo includes its own compose file for running the Eureka server standalone:

> Yaml code-highlight
services:
  arya-registry:
    image: arya-registry:latest
    ports:
      - "8761:8761"
    environment:
      SERVER_PORT: 8761
      SPRING_PROFILES_ACTIVE: default
    restart: unless-stopped
SettingValue
Service namearya-registry
Imagearya-registry:latest (built from the repo's own Dockerfile)
Port mapping8761:8761
SERVER_PORT8761 — overrides server.port at runtime
SPRING_PROFILES_ACTIVEdefault
Restart policyunless-stopped

No CI workflows exist in this repository — the Service Registry image is not published to a container registry. In the platform stack (arya-banking-infra/compose/platform.yml) it is referenced as karthikulkarni/arya-banking-service-registry:latest, so the image must be built and published separately.