Getting Started
Building, running, and configuring the Config Server application locally and via Docker.
Build Commands
The arya-banking-config-server uses Maven and is optimized for multi-stage Docker builds.
| Task | Command |
|---|---|
| Build Fat JAR | mvn -B -DskipTests package |
| Build Docker Image | docker build -t arya-banking-config-server:latest . |
| Start via Platform Stack | docker compose -f compose/platform.yml up -d (from arya-banking-infra) |
The project requires Java 17 and Spring Boot 3.5.x.
Multi-Stage Dockerfile
The production Dockerfile is securely designed to run as a non-root User (app).
# Stage 2 โ Runtime
FROM eclipse-temurin:17-jre-jammy
LABEL name="arya-banking-config-server" version="1.0.2"
RUN groupadd -r app \
&& useradd -r -m -d /home/app -s /bin/false -g app app \
&& mkdir -p /home/app/.config/jgit \
&& chown -R app:app /home/app
ENV HOME=/home/app
WORKDIR /app
COPY /workspace/target/arya-banking-config-server-*.jar /app/app.jar
EXPOSE 8090
USER app
ENTRYPOINT ["java","-Xms256m","-Xmx512m","-jar","/app/app.jar"]
JGit Configuration: The mkdir -p /home/app/.config/jgit step in the Dockerfile is critical. Spring Cloud Config uses JGit under the hood, which strictly requires a writable ~/.config/jgit path to successfully clone the arya-banking-configs repository in a containerized environment.
Environment Variables
When running locally or via Docker Compose, the following variables dictate the server's behavior:
| Variable | Default Value | Purpose |
|---|---|---|
SPRING_PROFILES_ACTIVE | default | Activates environment profiles. |
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE | http://localhost:8761/eureka | Override Eureka location (critical for Docker networking). |
SPRING_CLOUD_CONFIG_SERVER_GIT_URI | GitHub URL | The backend config repository URI to clone. |
Known Issues & Debugging
Several configuration bugs currently exist in the repository that may affect deployment:
- Typo in Eureka Zone: The
application.yamlin the config-server repository contains a typo (http://localhosat:8761/eureka) in theeureka.client.service-url.defaultZoneproperty. While environment variables mask this in Docker, running it standalone locally will fail to register with Eureka. - Compose Service Name Mismatch: The
docker-compose.ymlsets the Eureka URL pointing tohttp://registry:8761, but the dependency block is currently incorrectly namedservice-registry. - Missing Actuator: The server does not declare the
spring-boot-starter-actuatordependency, meaning/actuator/healthis inaccessible for Docker containerHEALTHCHECKassertions.
Docker Build & Deployment
Dockerfile Variants
The repository ships two Dockerfiles:
Dockerfileโ full multi-stage build: a Maven stage (maven:3.9.4-eclipse-temurin-17) compiles the JAR, then a runtime stage (eclipse-temurin:17-jre-jammy) runs it as a non-rootappuser with a writable JGit config directory. Labeledversion="1.0.2".Dockerfile.slimโ thin variant that skips the build stage and expects a pre-built JAR, producing a smaller image labeled1.0.2-slim.
# 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
LABEL name="arya-banking-config-server" version="1.0.2"
RUN groupadd -r app \
&& useradd -r -m -d /home/app -s /bin/false -g app app \
&& mkdir -p /home/app/.config/jgit \
&& chown -R app:app /home/app
ENV HOME=/home/app
WORKDIR /app
COPY /workspace/target/arya-banking-config-server-*.jar /app/app.jar
EXPOSE 8090
USER app
ENTRYPOINT ["java","-Xms256m","-Xmx512m","-jar","/app/app.jar"]
Key properties:
| Aspect | Setting |
|---|---|
| Base image (runtime) | eclipse-temurin:17-jre-jammy |
| JVM memory args | -Xms256m -Xmx512m |
| Exposed port | 8090 |
| Image labels | 1.0.2 (Dockerfile), 1.0.2-slim (Dockerfile.slim) |
| User | Non-root app with ~/.config/jgit prepared for Spring Cloud Config |
Standalone docker-compose.yml
The repo ships its own compose file that runs the Service Registry and Config Server on a dedicated arya-net (bridge) network:
services:
service-registry:
image: arya-banking-service-registry:latest
ports:
- "8761:8761"
networks:
- arya-net
config-server:
image: arya-banking-config-server:latest
ports:
- "8090:8090"
environment:
SPRING_PROFILES_ACTIVE: default
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://registry:8761/eureka/
depends_on:
- service-registry
networks:
- arya-net
networks:
arya-net:
driver: bridge
The container relies on two environment variables:
| Variable | Value |
|---|---|
SPRING_PROFILES_ACTIVE | default |
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE | http://registry:8761/eureka/ (Eureka location inside the compose network) |
Known issue โ the compose file points the Eureka zone at registry, but the container name and service are service-registry. The hostname mismatch means the Config Server cannot resolve registry on arya-net; align the defaultZone with the actual service name (http://service-registry:8761/eureka/).
Known issue โ application.yaml in the config-server repository contains a typo (http://localhosat:8761/eureka) in eureka.client.service-url.defaultZone. Environment variables mask this in Docker, but standalone local runs will fail to register with Eureka.