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) |
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"]
{{% alert icon="๐ก" context="primary" %}}
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.
{{% /alert %}}
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.