File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ .git
2+ .github
3+ target /
4+ * .md
5+ .gitignore
6+ .idea /
7+ * .iml
8+ .vscode /
9+ .DS_Store
10+ docker-compose * .yml
Original file line number Diff line number Diff line change 1+ # Stage 1 - Build
2+ FROM eclipse-temurin:21-jdk-alpine AS build
3+
4+ WORKDIR /app
5+
6+ COPY mvnw .
7+ COPY .mvn .mvn
8+ COPY pom.xml .
9+
10+ RUN chmod +x mvnw && ./mvnw dependency:go-offline -B
11+
12+ COPY src src
13+
14+ RUN ./mvnw clean package -DskipTests -B
15+
16+ # Stage 2 - Runtime
17+ FROM eclipse-temurin:21-jre-alpine AS runtime
18+
19+ LABEL maintainer="felipementel" \
20+ description="CRUD de usuarios em Spring Boot com Ports and Adapters"
21+
22+ RUN addgroup -S appgroup && adduser -S appuser -G appgroup
23+
24+ WORKDIR /app
25+
26+ COPY --from=build /app/target/*.jar app.jar
27+
28+ RUN chown appuser:appgroup app.jar
29+
30+ USER appuser
31+
32+ EXPOSE 8080
33+
34+ HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
35+ CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health/ready || exit 1
36+
37+ ENTRYPOINT ["java" , "-jar" , "app.jar" ]
You can’t perform that action at this time.
0 commit comments