fixing clients

new frontend
This commit is contained in:
stefan
2025-09-25 21:12:15 +02:00
parent 0cc25cb108
commit 3aa4e3c412
12 changed files with 1032 additions and 63 deletions
+16 -16
View File
@@ -3,7 +3,7 @@
# ===================================================================
# Multi-stage Dockerfile for Meldestelle API Gateway
# Features: Security hardening, monitoring support, optimal caching, BuildKit cache mounts
# Version: 2.0.0 - Canonical location with full optimization
# Version: 2.1.0 - Optimized and corrected version
# ===================================================================
# === CENTRALIZED BUILD ARGUMENTS ===
@@ -35,11 +35,10 @@ LABEL build.date="${BUILD_DATE}"
WORKDIR /workspace
# Gradle optimizations for containerized builds
# Gradle optimizations for containerized builds (removed deprecated configureondemand)
ENV GRADLE_OPTS="-Dorg.gradle.caching=true \
-Dorg.gradle.daemon=false \
-Dorg.gradle.parallel=true \
-Dorg.gradle.configureondemand=true \
-Dorg.gradle.workers.max=2 \
-Dorg.gradle.jvmargs=-Xmx2g \
-XX:+UseParallelGC \
@@ -59,27 +58,27 @@ COPY core/ core/
# Copy infrastructure directories (required by settings.gradle.kts)
COPY infrastructure/ infrastructure/
# Copy services directories (required by settings.gradle.kts)
COPY services/ services/
# Copy client directories (required by settings.gradle.kts)
COPY client/ client/
COPY clients/ clients/
# Copy docs directory (required by settings.gradle.kts)
COPY docs/ docs/
# Copy temporary directory (required by settings.gradle.kts)
COPY temp/ temp/
# Copy root build configuration
COPY build.gradle.kts ./
# Download and cache dependencies with BuildKit cache mount
# Download and cache dependencies with BuildKit cache mount (removed deprecated flag)
RUN --mount=type=cache,target=/home/gradle/.gradle/caches \
--mount=type=cache,target=/home/gradle/.gradle/wrapper \
./gradlew :infrastructure:gateway:dependencies --no-daemon --info
./gradlew :infrastructure:gateway:dependencies --info
# Build the application with optimizations and build cache
# Build the application with optimizations and build cache (removed deprecated flag)
RUN --mount=type=cache,target=/home/gradle/.gradle/caches \
--mount=type=cache,target=/home/gradle/.gradle/wrapper \
./gradlew :infrastructure:gateway:bootJar --no-daemon --info \
./gradlew :infrastructure:gateway:bootJar --info \
-Pspring.profiles.active=${SPRING_PROFILES_ACTIVE}
# Extract JAR layers for better caching in runtime stage
@@ -155,6 +154,7 @@ HEALTHCHECK --interval=15s --timeout=3s --start-period=40s --retries=3 \
CMD curl -fsS --max-time 2 http://localhost:8081/actuator/health/readiness || exit 1
# Optimized JVM settings for Spring Cloud Gateway with Java 21
# Removed deprecated UseTransparentHugePages flag for better compatibility
ENV JAVA_OPTS="-XX:MaxRAMPercentage=80.0 \
-XX:+UseG1GC \
-XX:+UseStringDeduplication \
@@ -162,8 +162,6 @@ ENV JAVA_OPTS="-XX:MaxRAMPercentage=80.0 \
-XX:G1HeapRegionSize=16m \
-XX:G1ReservePercent=25 \
-XX:InitiatingHeapOccupancyPercent=30 \
-XX:+UnlockExperimentalVMOptions \
-XX:+UseTransparentHugePages \
-XX:+AlwaysPreTouch \
-XX:+DisableExplicitGC \
-Djava.security.egd=file:/dev/./urandom \
@@ -175,7 +173,7 @@ ENV JAVA_OPTS="-XX:MaxRAMPercentage=80.0 \
-Dmanagement.endpoint.health.show-details=always \
-Dmanagement.prometheus.metrics.export.enabled=true"
# Spring Boot configuration
# Spring Boot configuration (consistent port variable usage)
ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE} \
SERVER_PORT=8081 \
@@ -183,11 +181,13 @@ ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
LOGGING_LEVEL_ORG_SPRINGFRAMEWORK_CLOUD_GATEWAY=DEBUG
# Enhanced entrypoint with tini init system and conditional debug support
# Fixed memory cgroup path for better compatibility with different container runtimes
ENTRYPOINT ["tini", "--", "sh", "-c", "\
echo 'Starting API Gateway with Java ${JAVA_VERSION}...'; \
echo 'Active Spring profiles: ${SPRING_PROFILES_ACTIVE}'; \
echo 'Gateway port: ${GATEWAY_PORT:-8081}'; \
echo 'Container memory: '$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes 2>/dev/null || echo 'unlimited'); \
echo 'Gateway port: ${SERVER_PORT}'; \
MEMORY_LIMIT=$(cat /sys/fs/cgroup/memory.max 2>/dev/null || cat /sys/fs/cgroup/memory/memory.limit_in_bytes 2>/dev/null || echo 'unlimited'); \
echo \"Container memory limit: $MEMORY_LIMIT\"; \
if [ \"${DEBUG:-false}\" = \"true\" ]; then \
echo 'DEBUG mode enabled - remote debugging available on port 5005'; \
exec java ${JAVA_OPTS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 org.springframework.boot.loader.launch.JarLauncher; \
+17 -13
View File
@@ -1,9 +1,9 @@
# syntax=docker/dockerfile:1.7
# syntax=docker/dockerfile:1.8
# ===================================================================
# Optimized Dockerfile for Spring Boot Ping Service
# Features: Multi-stage build, security hardening, monitoring support, enhanced caching
# Version: 2.0.0 - Enhanced optimization and security
# Multi-stage Dockerfile for Meldestelle Ping Service
# Features: Security hardening, monitoring support, optimal caching, BuildKit cache mounts
# Version: 2.1.0 - Optimized and corrected version
# ===================================================================
# === CENTRALIZED BUILD ARGUMENTS ===
@@ -29,13 +29,12 @@ LABEL stage=builder \
WORKDIR /workspace
# Optimize Gradle build settings for containerized builds
# Gradle optimizations for containerized builds (removed deprecated configureondemand)
ENV GRADLE_OPTS="-Dorg.gradle.caching=true \
-Dorg.gradle.daemon=false \
-Dorg.gradle.parallel=true \
-Dorg.gradle.configureondemand=true \
-Dorg.gradle.workers.max=2 \
-Dorg.gradle.jvmargs=-Xmx1536m \
-Dorg.gradle.jvmargs=-Xmx2g \
-XX:+UseParallelGC \
-XX:MaxMetaspaceSize=512m"
@@ -58,6 +57,9 @@ COPY core/ core/
# Copy infrastructure directories (required by settings.gradle.kts)
COPY infrastructure/ infrastructure/
# Copy services directories (required by settings.gradle.kts)
COPY services/ services/
# Copy docs directory (required by settings.gradle.kts)
COPY docs/ docs/
@@ -145,7 +147,8 @@ EXPOSE 8082 5005
HEALTHCHECK --interval=15s --timeout=3s --start-period=40s --retries=3 \
CMD curl -fsS --max-time 2 http://localhost:8082/actuator/health/readiness || exit 1
# Optimized JVM settings for Java 21 with enhanced container support
# Optimized JVM settings for Spring Boot microservice with Java 21
# Removed deprecated UseTransparentHugePages flag for better compatibility
ENV JAVA_OPTS="-XX:MaxRAMPercentage=75.0 \
-XX:+UseG1GC \
-XX:+UseStringDeduplication \
@@ -153,8 +156,6 @@ ENV JAVA_OPTS="-XX:MaxRAMPercentage=75.0 \
-XX:G1HeapRegionSize=16m \
-XX:G1ReservePercent=25 \
-XX:InitiatingHeapOccupancyPercent=30 \
-XX:+UnlockExperimentalVMOptions \
-XX:+UseTransparentHugePages \
-XX:+AlwaysPreTouch \
-XX:+DisableExplicitGC \
-Djava.security.egd=file:/dev/./urandom \
@@ -173,14 +174,17 @@ ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
LOGGING_LEVEL_ROOT=INFO
# Enhanced entrypoint with tini init system and conditional debug support
# Fixed memory cgroup path for better compatibility with different container runtimes
ENTRYPOINT ["tini", "--", "sh", "-c", "\
echo 'Starting ping-service with Java ${JAVA_VERSION}...'; \
echo 'Starting Ping Service with Java ${JAVA_VERSION}...'; \
echo 'Active Spring profiles: ${SPRING_PROFILES_ACTIVE}'; \
echo 'Container memory: '$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes 2>/dev/null || echo 'unlimited'); \
echo 'Service port: ${SERVER_PORT}'; \
MEMORY_LIMIT=$(cat /sys/fs/cgroup/memory.max 2>/dev/null || cat /sys/fs/cgroup/memory/memory.limit_in_bytes 2>/dev/null || echo 'unlimited'); \
echo \"Container memory limit: $MEMORY_LIMIT\"; \
if [ \"${DEBUG:-false}\" = \"true\" ]; then \
echo 'DEBUG mode enabled - remote debugging available on port 5005'; \
exec java ${JAVA_OPTS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -jar app.jar; \
else \
echo 'Starting application in production mode'; \
echo 'Starting Ping Service in production mode'; \
exec java ${JAVA_OPTS} -jar app.jar; \
fi"]