Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ jobs:
run: docker compose up -d --build --wait --wait-timeout 90

- name: Smoke (readiness < 30s, public surface served)
run: bash scripts/demo.sh
run: |
bash scripts/demo.sh http://localhost:8080
bash scripts/demo.sh http://localhost:8081

- name: Dump container logs on failure
if: failure()
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM eclipse-temurin:21-jdk AS builder
ARG SERVICE=ledger
WORKDIR /workspace
COPY . .
RUN chmod +x gradlew \
&& ./gradlew :services:ledger:bootJar --no-daemon -x test \
&& find services/ledger/build/libs -name '*.jar' ! -name '*-plain.jar' -exec cp {} /workspace/app.jar \;
&& ./gradlew :services:${SERVICE}:bootJar --no-daemon -x test \
&& find services/${SERVICE}/build/libs -name '*.jar' ! -name '*-plain.jar' -exec cp {} /workspace/app.jar \;

FROM gcr.io/distroless/java21-debian12:nonroot AS runtime
WORKDIR /app
Expand Down
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ services:
POSTGRES_DB: ledger
POSTGRES_USER: ledger
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-ledger}
volumes:
- ./scripts/initdb:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ledger -d ledger"]
interval: 2s
Expand All @@ -24,3 +26,20 @@ services:
SPRING_DATASOURCE_USERNAME: ledger
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-ledger}
KEYCLOAK_ISSUER_URI: http://localhost/realms/fincore

payments:
build:
context: .
args:
SERVICE: payments
depends_on:
postgres:
condition: service_healthy
ports:
- "8081:8080"
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/payments
SPRING_DATASOURCE_USERNAME: ledger
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-ledger}
KEYCLOAK_ISSUER_URI: http://localhost/realms/fincore
FINCORE_PAYMENTS_BANK_SANDBOX_ENABLED: "true"
6 changes: 3 additions & 3 deletions scripts/demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ for i in $(seq 1 "$attempts"); do
done

if [ "$ready" != true ]; then
echo "FAIL: ledger readiness not UP within $((attempts * interval))s at $READINESS"
echo "FAIL: readiness not UP within $((attempts * interval))s at $READINESS"
exit 1
fi

if ! curl -fsS -o /dev/null "$LIVENESS"; then
echo "FAIL: ledger liveness not UP at $LIVENESS"
echo "FAIL: liveness not UP at $LIVENESS"
exit 1
fi

Expand All @@ -34,4 +34,4 @@ if [ "$code" != "200" ]; then
exit 1
fi

echo "ledger smoke OK: readiness UP, liveness UP, api-docs 200"
echo "smoke OK ($BASE_URL): readiness UP, liveness UP, api-docs 200"
5 changes: 5 additions & 0 deletions scripts/initdb/01-create-payments-db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- SPDX-License-Identifier: BUSL-1.1
-- SPDX-FileCopyrightText: 2026 FinCore Engine Authors
-- Runs once on first postgres init (empty data dir). Gives payments its own
-- database so its Liquibase DATABASECHANGELOG/lock stay isolated from ledger.
CREATE DATABASE payments OWNER ledger;
Loading