feat: add gateway-service (Spring Cloud Gateway + Consul)

This commit is contained in:
2026-02-17 19:34:49 +01:00
parent 5a05bb2147
commit 008aceb64b
11 changed files with 464 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
# --- Build stage ---
FROM maven:3.9.9-eclipse-temurin-24-alpine AS build
WORKDIR /app
COPY pom.xml .
RUN mvn dependency:go-offline -B
COPY src ./src
RUN mvn clean package -DskipTests -B
# --- Runtime stage ---
FROM eclipse-temurin:25-jre-alpine
WORKDIR /app
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
COPY --from=build /app/target/*.jar app.jar
RUN chown -R appuser:appgroup /app
USER appuser
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD wget -qO- http://localhost:8080/actuator/health || exit 1
ENTRYPOINT ["java", "-jar", "app.jar", "--spring.profiles.active=prod"]