From dc38c1e34803110cf47b60ce1340888d75f99cce Mon Sep 17 00:00:00 2001 From: konsthol Date: Tue, 27 May 2025 13:57:13 +0300 Subject: [PATCH] I can't believe it took so long to fix this. --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index df16e88..72c2130 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"]