aboutsummaryrefslogtreecommitdiff
path: root/src/main/docker/Dockerfile.multistage
blob: 8505c80a9b977ff6580d80727aa81c1091fd61c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
## Stage 1 : build with maven builder image with native capabilities - Quinoa will bake in the front-end
FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:23.1-jdk-21 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 ./mvnw -B org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline
ENV QUARKUS_QUINOA_PACKAGE_MANAGER_INSTALL=true QUARKUS_QUINOA_PACKAGE_MANAGER_INSTALL_NODE_VERSION=18.13.0
COPY --chown=quarkus:quarkus . /code
RUN ./mvnw -Pnative clean package

## Stage 2 : create the docker final image
FROM quay.io/quarkus/quarkus-distroless-image:2.0 AS release
COPY --from=build /code/target/*-runner /application

EXPOSE 8080
USER nonroot

CMD ["/application", "-XX:+PrintGC", "-XX:+PrintGCTimeStamps", "-XX:+VerboseGC", "+XX:+PrintHeapShape", "-Xmx128m", "-Dquarkus.http.host=0.0.0.0"]