covas-quarkus/Dockerfile

39 lines
978 B
Docker
Raw Normal View History

2022-06-29 23:54:51 +02:00
####
2022-10-15 21:31:27 +02:00
# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode
2022-06-29 23:54:51 +02:00
#
2022-10-15 21:31:27 +02:00
# Build the image with:
2022-06-29 23:54:51 +02:00
#
2022-10-15 21:31:27 +02:00
# docker build -f src/main/docker/Dockerfile.multistage -t quarkus/rest-json .
2022-06-29 23:54:51 +02:00
#
# Then run the container using:
#
2022-10-15 21:31:27 +02:00
# docker run -i --rm -p 8080:8080 quarkus/rest-json
2022-06-29 23:54:51 +02:00
#
###
2022-10-15 21:31:27 +02:00
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
RUN mvn -Pnative package
2022-06-29 23:54:51 +02:00
2022-10-15 21:31:27 +02:00
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
2022-06-29 23:54:51 +02:00
EXPOSE 8080
2022-10-15 21:31:27 +02:00
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]