Integrate billing-service microservice: add API gateway routing, service discovery with Consul, Docker support, and Spring configuration. Update frontend with API integration, BillingRepository, and BillingViewModel.

This commit is contained in:
2026-04-12 18:00:38 +02:00
parent 11abbf0179
commit 0f2060fc14
12 changed files with 376 additions and 59 deletions
+73
View File
@@ -63,6 +63,7 @@ services:
EVENTS_SERVICE_URL: "http://events-service:8085"
ZNS_IMPORT_SERVICE_URL: "http://zns-import-service:8095"
RESULTS_SERVICE_URL: "http://results-service:8088"
BILLING_SERVICE_URL: "http://billing-service:8087"
depends_on:
postgres:
@@ -466,6 +467,78 @@ services:
volumes:
- ./config/app/base-application.yaml:/workspace/config/application.yml:Z
# --- MICROSERVICE: Billing Service ---
billing-service:
image: "${DOCKER_REGISTRY:-git.mo-code.at/mo-code}/billing-service:${DOCKER_TAG:-latest}"
build:
context: .
dockerfile: backend/services/billing/billing-service/Dockerfile
args:
GRADLE_VERSION: "${DOCKER_GRADLE_VERSION:-9.3.1}"
JAVA_VERSION: "${DOCKER_JAVA_VERSION:-25}"
VERSION: "${DOCKER_VERSION:-1.0.0-SNAPSHOT}"
BUILD_DATE: "${DOCKER_BUILD_DATE}"
labels:
- "org.opencontainers.image.created=${DOCKER_BUILD_DATE}"
container_name: "${PROJECT_NAME:-meldestelle}-billing-service"
restart: unless-stopped
ports:
- "${BILLING_PORT:-8087:8087}"
- "${BILLING_DEBUG_PORT:-5012:5012}"
environment:
SPRING_PROFILES_ACTIVE: "${BILLING_SPRING_PROFILES_ACTIVE:-docker}"
DEBUG: "${BILLING_DEBUG:-true}"
SERVER_PORT: "${BILLING_SERVER_PORT:-8087}"
# --- KEYCLOAK ---
SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUER_URI: "${KC_ISSUER_URI:-http://localhost:8180/realms/meldestelle}"
SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWK_SET_URI: "${KC_JWK_SET_URI:-http://keycloak:8080/realms/meldestelle/protocol/openid-connect/certs}"
# --- CONSUL ---
SPRING_CLOUD_CONSUL_HOST: "${CONSUL_HOST:-consul}"
SPRING_CLOUD_CONSUL_PORT: "${CONSUL_HTTP_PORT:-8500}"
SPRING_CLOUD_CONSUL_DISCOVERY_SERVICE_NAME: "${BILLING_SERVICE_NAME:-billing-service}"
SPRING_CLOUD_CONSUL_DISCOVERY_PREFER_IP_ADDRESS: "${BILLING_CONSUL_PREFER_IP:-true}"
# - DATENBANK VERBINDUNG -
SPRING_DATASOURCE_URL: "${POSTGRES_DB_URL:-jdbc:postgresql://postgres:5432/pg-meldestelle-db}"
SPRING_DATASOURCE_USERNAME: "${POSTGRES_USER:-pg-user}"
SPRING_DATASOURCE_PASSWORD: "${POSTGRES_PASSWORD:-pg-password}"
# --- VALKEY ---
SPRING_DATA_VALKEY_HOST: "${VALKEY_SERVER_HOSTNAME:-valkey}"
SPRING_DATA_VALKEY_PORT: "${VALKEY_SERVER_PORT:-6379}"
# --- ZIPKIN ---
MANAGEMENT_ZIPKIN_TRACING_ENDPOINT: "${ZIPKIN_ENDPOINT:-http://zipkin:9411/api/v2/spans}"
depends_on:
postgres:
condition: "service_healthy"
keycloak:
condition: "service_healthy"
consul:
condition: "service_healthy"
valkey:
condition: "service_healthy"
zipkin:
condition: "service_started"
healthcheck:
test: [ "CMD", "wget", "--spider", "-q", "http://localhost:8087/actuator/health/readiness" ]
interval: 15s
timeout: 5s
retries: 5
start_period: 40s
networks:
meldestelle-network:
aliases:
- "billing-service"
profiles: [ "backend", "all" ]
volumes:
- ./config/app/base-application.yaml:/workspace/config/application.yml:Z
# --- MICROSERVICE: Series Service ---
series-service:
image: "${DOCKER_REGISTRY:-git.mo-code.at/mo-code}/series-service:${DOCKER_TAG:-latest}"