-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (44 loc) · 1.9 KB
/
Dockerfile
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21 AS build
# Receiving app version
ARG APP_VERSION=0.0.1
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
RUN ./mvnw versions:set -DnewVersion=${APP_VERSION} -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true && \
./mvnw versions:commit -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true
### NATIVE BUILD
RUN ./mvnw package -Pnative -DskipTests
### JVM BUILD
#RUN ./mvnw package -DskipTests
HEALTHCHECK --interval=300s --timeout=30s CMD ./mvnw --version || exit 1
###
###
###
FROM quay.io/quarkus/quarkus-micro-image:2.0 AS deploy
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
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"]
#####
#FROM registry.access.redhat.com/ubi8/openjdk-21:1.19
#ENV LANGUAGE='en_US:en'
# We make four distinct layers so if there are application changes the library layers can be re-used
#COPY --chown=185 --from=build /code/target/quarkus-app/lib/ /deployments/lib/
#COPY --chown=185 --from=build /code/target/quarkus-app/*.jar /deployments/
#COPY --chown=185 --from=build /code/target/quarkus-app/app/ /deployments/app/
#COPY --chown=185 --from=build /code/target/quarkus-app/quarkus/ /deployments/quarkus/
#EXPOSE 8080
#USER 185
#ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
#ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
#ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]