build: move Dockerfile under src/main/docker
- Restore the Quarkus-default location for the container build recipe - Drop the stale !Dockerfile entry from .dockerignore (file no longer at root)
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
## Stage 1 : build with maven builder image with native capabilities
|
||||
FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image: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
|
||||
COPY src /code/src
|
||||
RUN ./mvnw package -Dnative
|
||||
|
||||
## Stage 2 : create the docker final image
|
||||
FROM quay.io/quarkus/quarkus-micro-image:2.0
|
||||
WORKDIR /work/
|
||||
COPY --from=build /code/target/*-runner /work/application
|
||||
|
||||
# set up permissions for user `1001`
|
||||
RUN chmod 775 /work /work/application \
|
||||
&& chown -R 1001 /work \
|
||||
&& chmod -R "g+rwX" /work \
|
||||
&& chown -R 1001:root /work
|
||||
|
||||
EXPOSE 8080
|
||||
USER 1001
|
||||
|
||||
#TimeZone
|
||||
ENV TZ="America/Santiago"
|
||||
|
||||
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
|
||||
Reference in New Issue
Block a user