I can't believe it took so long to fix this.
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
# Use a minimal java image
|
# Use a minimal java image
|
||||||
FROM openjdk:21-jdk-slim
|
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
|
# Set the working directory inside the container
|
||||||
WORKDIR /work/
|
WORKDIR /work/
|
||||||
|
|
||||||
@@ -12,10 +16,10 @@ RUN chown 1001 /work \
|
|||||||
COPY --chown=1001:root quarkus-app/ /work/quarkus-app
|
COPY --chown=1001:root quarkus-app/ /work/quarkus-app
|
||||||
|
|
||||||
# Expose the application's port
|
# Expose the application's port
|
||||||
EXPOSE 8090
|
EXPOSE $APP_PORT
|
||||||
|
|
||||||
# Switch to non-root user for better security
|
# Switch to non-root user for better security
|
||||||
USER 1001
|
USER 1001
|
||||||
|
|
||||||
# Define the entrypoint to run the JAR
|
# 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"]
|
||||||
|
|||||||
Reference in New Issue
Block a user