e76bc06f68
- Spring Boot REST API with CRUD operations - PostgreSQL with HikariCP connection pool - Multi-stage Docker build (Gradle 8.14 + JRE Alpine) - Docker Compose orchestration - Prometheus metrics collection - Grafana dashboards (app & database) - Clean layered architecture (Entity/Repository/Service/Controller/DTO) - Global exception handling - Actuator health checks
20 lines
351 B
Docker
20 lines
351 B
Docker
FROM gradle:8.14-jdk21 AS build
|
|
|
|
WORKDIR /app
|
|
|
|
COPY build.gradle settings.gradle ./
|
|
COPY gradle ./gradle
|
|
COPY src ./src
|
|
|
|
RUN gradle clean build -x test --no-daemon
|
|
|
|
FROM eclipse-temurin:21-jre-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build /app/build/libs/*.jar app.jar
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["java", "-Djava.net.preferIPv4Stack=true", "-jar", "app.jar"]
|