-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 707 Bytes
/
Dockerfile
File metadata and controls
29 lines (21 loc) · 707 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
# use OpenJDK 21 slim base image
FROM openjdk:21-jdk-slim
# set working directory
WORKDIR /app
# copy Gradle wrapper and build files first for better layer 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 inside the image (skip tests for faster builds)
RUN ./gradlew build -x test
# copy the runnable JAR (exclude *-plain.jar) to a consistent path
RUN find build/libs -name "*.jar" -not -name "*-plain.jar" -exec cp {} app.jar \;
# expose the application port we are using
EXPOSE 8080
# run the application
ENTRYPOINT ["java", "-jar", "/app/app.jar"]