refactoring: Env-Dateien und Docker-Dateien

This commit is contained in:
Stefan Mogeritsch 2025-11-21 22:37:36 +01:00
parent b1c95c1d34
commit 2935190fcd
5 changed files with 1499 additions and 232 deletions

11
.env
View File

@ -21,12 +21,9 @@ POSTGRES_PORT=5432:5432
REDIS_PORT=6379:6379
# --- KEYCLOAK (Identity Provider) ---
# Admin Login für die Konsole
KC_ADMIN_USER=kc-admin
KC_ADMIN_PASSWORD=kc-password
# Hostname (Wichtig für Redirects)
KC_HOSTNAME=localhost
# Port Mapping
KC_PORT=8180:8080
# --- PGADMIN (DB GUI) ---
@ -46,10 +43,10 @@ GF_PORT=3000:3000
CONSUL_PORT=8500:8500
# --- API GATEWAY ---
# Der Port, der nach außen für Clients (Web App) offen ist
GATEWAY_PORT=8081
# Debug Port für IntelliJ (Remote JVM Debug)
GATEWAY_DEBUG_PORT=5005
GATEWAY_PORT=8081:8081
GATEWAY_DEBUG_PORT=5005:5005
GATEWAY_SERVER_PORT=8081
# --- MICROSERVICES ---
PING_SERVICE_PORT=8082:8082
PING_DEBUG_PORT=5006:5006

View File

@ -168,13 +168,14 @@ services:
GRADLE_VERSION: 9.1.0
JAVA_VERSION: 21
VERSION: 1.0.0
BUILD_DATE: "2025-11-20"
BUILD_DATE: "2025-11-21"
container_name: ${COMPOSE_PROJECT_NAME}-gateway
restart: no
ports:
- "${GATEWAY_PORT}"
- "${GATEWAY_DEBUG_PORT}" # Für Remote Debugging
environment:
SERVER_PORT: ${GATEWAY_SERVER_PORT}
SPRING_PROFILES_ACTIVE: docker
DEBUG: "true"
# --- VERBINDUNGEN ---
@ -213,12 +214,12 @@ services:
GRADLE_VERSION: 9.1.0
JAVA_VERSION: 21
VERSION: 1.0.0
BUILD_DATE: "2025-11-20"
BUILD_DATE: "2025-11-21"
container_name: ${COMPOSE_PROJECT_NAME}-ping-service
restart: no # "${RESTART_POLICY:-unless-stopped}"
ports:
- "${PING_SERVICE_PORT}"
- "5006:5005" # Debug Port
- "${PING_DEBUG_PORT}"
environment:
SPRING_PROFILES_ACTIVE: docker
DEBUG: "true"
@ -241,6 +242,13 @@ services:
# Wir nutzen den Service-Namen, genau wie bei Postgres
SPRING_DATA_REDIS_HOST: ${COMPOSE_PROJECT_NAME}-redis
SPRING_DATA_REDIS_PORT: 6379
depends_on:
consul:
condition: service_healthy
postgres:
condition: service_healthy
keycloak:
condition: service_healthy
networks:
- meldestelle-network

View File

@ -18,6 +18,7 @@ kotlinx-coroutines = "1.10.2"
# --- Spring Ecosystem ---
springBoot = "3.5.6"
springCloud = "2025.0.0"
springCloudGateway = "4.3.0"
springDependencyManagement = "1.1.7"
springdoc = "2.8.13"

View File

@ -1,6 +1,6 @@
# Port, auf dem das Gateway läuft
server:
port: ${GATEWAY_PORT:8081}
port: ${SERVER_PORT:8081}
# Optimierte Netty-Konfiguration für reaktive Anwendungen
netty:
connection-timeout: 5s
@ -74,91 +74,24 @@ spring:
value: no-cache, no-store, must-revalidate
routes:
# ==============================================================
# --- Gateway-Info-Route (optional) ---
# ==============================================================
# ==============================================================
# --- Gateway-Info-Route (optional) ---
# ==============================================================
- id: gateway-info-route
uri: http://localhost:${server.port}
predicates:
- Path=/
- Method=GET
filters:
- SetStatus=200
- SetResponseHeader=Content-Type,application/json
- name: setStatus
args:
status: 200
- name: setResponseHeader
args:
Content-Type: application/json
# ==============================================================
# --- Members-Service-Integration (optional) ---
# ==============================================================
# - id: members-service-route
# uri: lb://members-service
# predicates:
# - Path=/api/members/**
# filters:
# - StripPrefix=1
# - name: CircuitBreaker
# args:
# name: membersCircuitBreaker
# fallbackUri: forward:/fallback/members
# ==============================================================
# --- Horses-Service-Integration (optional) ---
# ==============================================================
# - id: horses-service-route
# uri: lb://horses-service
# predicates:
# - Path=/api/horses/**
# filters:
# - StripPrefix=1
# - name: CircuitBreaker
# args:
# name: horsesCircuitBreaker
# fallbackUri: forward:/fallback/horses
# ==============================================================
# --- Events-Service-Integration (optional) ---
# ==============================================================
# - id: events-service-route
# uri: lb://events-service
# predicates:
# - Path=/api/events/**
# filters:
# - StripPrefix=1
# - name: CircuitBreaker
# args:
# name: eventsCircuitBreaker
# fallbackUri: forward:/fallback/events
# ==============================================================
# --- Masterdata-Service-Integration (optional) ---
# ==============================================================
# - id: masterdata-service-route
# uri: lb://masterdata-service
# predicates:
# - Path=/api/masterdata/**
# filters:
# - StripPrefix=1
# - name: CircuitBreaker
# args:
# name: masterdataCircuitBreaker
# fallbackUri: forward:/fallback/masterdata
# ==============================================================
# --- Auth-Service-Integration (optional) ---
# ==============================================================
# - id: auth-service-route
# uri: lb://auth-service
# predicates:
# - Path=/api/auth/**
# filters:
# - StripPrefix=1
# - name: CircuitBreaker
# args:
# name: authCircuitBreaker
# fallbackUri: forward:/fallback/auth
# ==============================================================
# --- Ping-Service-Integration (optional) ---
# ==============================================================
# ==============================================================
# --- Ping-Service-Integration (optional) ---
# ==============================================================
- id: ping-service-route
uri: lb://ping-service
predicates:
@ -166,6 +99,75 @@ spring:
filters:
- StripPrefix=1
# ==============================================================
# --- Members-Service-Integration (optional) ---
# ==============================================================
# - id: members-service-route
# uri: lb://members-service
# predicates:
# - Path=/api/members/**
# filters:
# - StripPrefix=1
# - name: CircuitBreaker
# args:
# name: membersCircuitBreaker
# fallbackUri: forward:/fallback/members
# ==============================================================
# --- Horses-Service-Integration (optional) ---
# ==============================================================
# - id: horses-service-route
# uri: lb://horses-service
# predicates:
# - Path=/api/horses/**
# filters:
# - StripPrefix=1
# - name: CircuitBreaker
# args:
# name: horsesCircuitBreaker
# fallbackUri: forward:/fallback/horses
# ==============================================================
# --- Events-Service-Integration (optional) ---
# ==============================================================
# - id: events-service-route
# uri: lb://events-service
# predicates:
# - Path=/api/events/**
# filters:
# - StripPrefix=1
# - name: CircuitBreaker
# args:
# name: eventsCircuitBreaker
# fallbackUri: forward:/fallback/events
# ==============================================================
# --- Masterdata-Service-Integration (optional) ---
# ==============================================================
# - id: masterdata-service-route
# uri: lb://masterdata-service
# predicates:
# - Path=/api/masterdata/**
# filters:
# - StripPrefix=1
# - name: CircuitBreaker
# args:
# name: masterdataCircuitBreaker
# fallbackUri: forward:/fallback/masterdata
# ==============================================================
# --- Auth-Service-Integration (optional) ---
# ==============================================================
# - id: auth-service-route
# uri: lb://auth-service
# predicates:
# - Path=/api/auth/**
# filters:
# - StripPrefix=1
# - name: CircuitBreaker
# args:
# name: authCircuitBreaker
# fallbackUri: forward:/fallback/auth
# Circuit Breaker Konfiguration
resilience4j:
circuitbreaker:

File diff suppressed because it is too large Load Diff