2024-03-02 12:29:10 +03:00
|
|
|
####
|
2024-03-09 20:54:23 +03:00
|
|
|
# This Dockerfile.native is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
|
2024-03-02 12:29:10 +03:00
|
|
|
# It uses a micro base image, tuned for Quarkus native executables.
|
|
|
|
# It reduces the size of the resulting container image.
|
|
|
|
# Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image.
|
|
|
|
#
|
|
|
|
# Before building the container image run:
|
|
|
|
#
|
2024-03-09 20:54:23 +03:00
|
|
|
# ./mvnw package -Dnative -Dquarkus.native.remote-container-build=true
|
2024-03-02 12:29:10 +03:00
|
|
|
#
|
|
|
|
# Then, build the image with:
|
|
|
|
#
|
2024-03-09 20:54:23 +03:00
|
|
|
# docker build -t quarkus/social-network:latest .
|
2024-03-02 12:29:10 +03:00
|
|
|
#
|
|
|
|
# Then run the container using:
|
|
|
|
#
|
2024-03-09 20:54:23 +03:00
|
|
|
# docker run -i --rm -p 8080:8080 quarkus/social-network:latest
|
2024-03-02 12:29:10 +03:00
|
|
|
#
|
|
|
|
###
|
|
|
|
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 target/*-runner /work/application
|
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
USER 1001
|
|
|
|
|
|
|
|
ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]
|