generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deps: quarkus graalvmce build base (#23)
* deps: quarkus graalvmce build base * Chop down build * Comments and layout * Simplify Dockerfile, use .dockerignore, comments
- Loading branch information
1 parent
4399dd9
commit 85b203f
Showing
2 changed files
with
23 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
target/** | ||
.dockerignore | ||
.gitignore | ||
Dockerfile | ||
mvnw.cmd | ||
*.yml | ||
*.yaml | ||
*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
FROM quay.io/quarkus/ubi-quarkus-native-image:22.3.0-java17 AS build | ||
COPY --chown=quarkus:quarkus mvnw /code/mvnw | ||
COPY --chown=quarkus:quarkus .mvn /code/.mvn | ||
COPY --chown=quarkus:quarkus pom.xml /code/ | ||
USER quarkus | ||
WORKDIR /code | ||
RUN chmod +x mvnw | ||
RUN ./mvnw -B org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline | ||
COPY src /code/src | ||
# Quarkus Images | ||
# https://github.com/quarkusio/quarkus-images | ||
|
||
# "Provides the native-image executable. Used by the Maven and Gradle plugin from Quarkus to build linux64 executables" | ||
FROM quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.3.3-java17 AS build | ||
|
||
# Image defaults to /project; copy controlled by .dockerignore | ||
COPY --chown=quarkus:quarkus . ./ | ||
RUN ./mvnw package -Pnative -DskipTests | ||
HEALTHCHECK --interval=300s --timeout=30s CMD ./mvnw --version || exit 1 | ||
### | ||
|
||
# "A base image to run Quarkus native application using UBI Micro" | ||
FROM quay.io/quarkus/quarkus-micro-image:2.0 | ||
WORKDIR /work/ | ||
RUN chown 1001 /work \ | ||
&& chmod "g+rwX" /work \ | ||
&& chown 1001:root /work | ||
COPY --chown=1001:root --from=build /code/target/*-runner /work/application | ||
|
||
# Port and health check | ||
EXPOSE 3000 | ||
USER 1001 | ||
HEALTHCHECK --interval=300s --timeout=3s CMD curl -f http://localhost:3000/ || exit 1 | ||
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] | ||
|
||
# Startup | ||
COPY --chown=1001:root --from=build /project/target/*-runner /app | ||
USER 1001 | ||
CMD ["/app", "-Dquarkus.http.host=0.0.0.0"] |