-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (32 loc) · 1.26 KB
/
Copy pathDockerfile
File metadata and controls
34 lines (32 loc) · 1.26 KB
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
# This Dockerfile builds and runs a Java application using Payara Micro and Eclipse Temurin JDK 21.
#
# ARG PAYARA_VERSION=6.2024.11-jdk21
# - Defines the version of Payara Micro to be used.
#
# FROM eclipse-temurin:21-jdk AS build
# - Uses Eclipse Temurin JDK 21 as the base image for the build stage.
#
# WORKDIR /app
# - Sets the working directory to /app.
#
# COPY . /app
# - Copies the entire project into the /app directory in the container.
#
# RUN --mount=type=cache,target=/root/.m2 ./mvnw -Dskiptest package
# - Uses Maven Wrapper to build the project, skipping tests, and caches dependencies.
#
# FROM payara/micro:${PAYARA_VERSION}
# - Uses the specified version of Payara Micro as the base image for the runtime stage.
#
# COPY --from=build /app/target/*war ${DEPLOY_DIR}/
# - Copies the built WAR file from the build stage to the deployment directory in the runtime stage.
#
# ENTRYPOINT java -jar ${PAYARA_DIR}/payara-micro.jar --deploy ${DEPLOY_DIR}/*.war
# - Sets the entry point to run Payara Micro and deploy the WAR file.
ARG PAYARA_VERSION=6.2024.11-jdk21
FROM eclipse-temurin:21-jdk AS build
WORKDIR /app
COPY . /app
RUN --mount=type=cache,target=/root/.m2 ./mvnw -Dskiptest package
FROM payara/micro:${PAYARA_VERSION}
COPY --from=build /app/target/*war ${DEPLOY_DIR}