From 5e02c6e708c681d3632ee45ed59415392e3a296f Mon Sep 17 00:00:00 2001 From: konsthol Date: Tue, 27 May 2025 14:14:55 +0300 Subject: [PATCH] ffs --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index df16e88..fc61dd1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ # Use a minimal java image FROM openjdk:21-jdk-slim +# Define build-time argument with default value +ARG APP_PORT=8090 +ENV QUARKUS_HTTP_PORT=$APP_PORT + # Set the working directory inside the container WORKDIR /work/ @@ -12,10 +16,10 @@ RUN chown 1001 /work \ COPY --chown=1001:root quarkus-app/ /work/quarkus-app # Expose the application's port -EXPOSE 8090 +EXPOSE $APP_PORT # Switch to non-root user for better security USER 1001 # Define the entrypoint to run the JAR -CMD ["java", "-Dquarkus.http.host=0.0.0.0", "-Dquarkus.http.port=8090", "-jar", "/work/quarkus-app/quarkus-run.jar"] +CMD ["java", "-Dquarkus.http.host=0.0.0.0", "-Dquarkus.http.port=${QUARKUS_HTTP_PORT}", "-jar", "/work/quarkus-app/quarkus-run.jar"]