fixing(Gateway)

This commit is contained in:
stefan
2025-08-13 14:18:59 +02:00
parent 93633b38a7
commit 562eb07be1
21 changed files with 2081 additions and 94 deletions
+24 -6
View File
@@ -1,17 +1,35 @@
FROM openjdk:17-jre-slim
# Use Eclipse Temurin for better security, smaller image size, and active support
FROM eclipse-temurin:21-jre-alpine
# Add metadata labels
LABEL maintainer="Meldestelle Team"
LABEL description="API Gateway for Meldestelle System"
LABEL version="1.0"
# Install curl for health checks and create non-root user
RUN apk add --no-cache curl && \
addgroup -g 1001 -S gateway && \
adduser -u 1001 -S gateway -G gateway
# Set working directory
WORKDIR /app
# Copy the gateway JAR file
# Copy the gateway JAR file and set ownership
COPY infrastructure/gateway/build/libs/*.jar app.jar
RUN chown gateway:gateway app.jar
# Switch to non-root user
USER gateway
# Expose port
EXPOSE 8080
# Add health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=30s --retries=3 \
# Add optimized health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8080/actuator/health || exit 1
# Run the application
ENTRYPOINT ["java", "-jar", "app.jar"]
# Configure JVM for containerized Spring Boot reactive application
ENV JAVA_OPTS="-Xmx512m -Xms256m -XX:+UseG1GC -XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/./urandom"
# Run the application with optimized JVM settings
ENTRYPOINT ["sh", "-c", "java $JAVA_OPTS -jar app.jar"]