#### # This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode # # Build the image with: # # docker build -f src/main/docker/Dockerfile.multistage -t quarkus/rest-json . # # Then run the container using: # # docker run -i --rm -p 8080:8080 quarkus/rest-json # ### FROM quay.io/quarkus/centos-quarkus-maven:21.3.0-java11 AS build USER quarkus COPY --chown=quarkus:quarkus ./pom.xml ./pom.xml COPY --chown=quarkus:quarkus ./src ./src ARG POSTGRES_PASSWORD ARG POSTGRES_USER ARG POSTGRES_DB ARG POSTGRES_URL ARG POSTGRES_PORT ARG REDIS_URL ARG REDIS_PORT ARG MAILER_FROM ARG MAILER_HOST ARG MAILER_PORT ARG MAILER_USERNAME ARG MAILER_PASSWORD RUN mvn -Pnative package FROM registry.access.redhat.com/ubi8/ubi-minimal WORKDIR /work/ COPY --from=build /project/target/*-runner /work/application RUN chmod 755 /work ARG POSTGRES_PASSWORD ARG POSTGRES_USER ARG POSTGRES_DB ARG POSTGRES_URL ARG POSTGRES_PORT ARG REDIS_URL ARG REDIS_PORT ARG MAILER_FROM ARG MAILER_HOST ARG MAILER_PORT ARG MAILER_USERNAME ARG MAILER_PASSWORD EXPOSE 8080 CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]