-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 803 Bytes
/
Dockerfile
File metadata and controls
36 lines (27 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Build stage
FROM eclipse-temurin:21-jdk-alpine AS build
WORKDIR /app
# Copy gradle files first for better caching
COPY gradlew .
COPY gradle gradle
COPY build.gradle .
COPY settings.gradle .
# Make gradlew executable
RUN chmod +x gradlew
# Copy source code
COPY src src
# Build the application
RUN ./gradlew build -Dquarkus.package.jar.type=uber-jar -x test
# Runtime stage
FROM eclipse-temurin:21-jre-alpine
WORKDIR /app
# Copy the built jar
COPY --from=build /app/build/*-runner.jar app.jar
# Expose port
ENV PORT=8080
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=60s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/q/health || exit 1
# Run the application
CMD ["java", "-Dquarkus.http.host=0.0.0.0", "-jar", "app.jar"]