-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
29 lines (22 loc) · 725 Bytes
/
dockerfile
File metadata and controls
29 lines (22 loc) · 725 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
# ---------- Build ----------
FROM maven:3.9.6-eclipse-temurin-17 AS build
WORKDIR /app
COPY pom.xml .
RUN mvn -B dependency:resolve
COPY src ./src
RUN mvn -B clean package -DskipTests
# ---------- Runtime ----------
FROM eclipse-temurin:17-jre
WORKDIR /app
# Install curl for healthcheck
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# Copy the built jar
COPY --from=build /app/target/*.jar app.jar
# Expose the port used by Spring Boot
EXPOSE 8080
# Optional: Set a default timezone (helps with logs in Kibana)
ENV TZ=UTC
# Optional: Pass Java opts (if you want to configure memory)
ENV JAVA_OPTS="-Xms256m -Xmx512m"
# Entry point
ENTRYPOINT ["sh","-c","java $JAVA_OPTS -jar app.jar"]