From 74642c102312bc5010331b88d06027a1ea101f55 Mon Sep 17 00:00:00 2001 From: James Ward Date: Thu, 16 Jul 2026 00:23:23 -0400 Subject: [PATCH] chore: use `SERVER_PORT` env var for listening port (#2018) --- Dockerfile | 6 ++---- backend/src/main/resources/application.yaml | 2 +- deploy/podman/quadlet/grimmory.container | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index d0f540490..abfce70a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -123,12 +123,10 @@ LABEL org.opencontainers.image.title="Grimmory" \ ENV APP_VERSION=${APP_VERSION} \ APP_REVISION=${APP_REVISION} -ARG BOOKLORE_PORT=6060 -ENV BOOKLORE_PORT=${BOOKLORE_PORT} -EXPOSE ${BOOKLORE_PORT} +EXPOSE 6060 HEALTHCHECK --interval=60s --timeout=10s --start-period=60s --retries=5 \ - CMD wget -q --spider http://localhost:${BOOKLORE_PORT}/api/v1/healthcheck + CMD wget -q --spider http://localhost:${SERVER_PORT:-${BOOKLORE_PORT:-6060}}/api/v1/healthcheck ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] CMD ["java", "--enable-native-access=ALL-UNNAMED", "--enable-preview", "-jar", "/app/app.jar"] diff --git a/backend/src/main/resources/application.yaml b/backend/src/main/resources/application.yaml index b8e607b77..fe74dba32 100644 --- a/backend/src/main/resources/application.yaml +++ b/backend/src/main/resources/application.yaml @@ -24,7 +24,7 @@ app: server: forward-headers-strategy: native - port: ${BOOKLORE_PORT:6060} + port: ${SERVER_PORT:${BOOKLORE_PORT:6060}} compression: enabled: true mime-types: text/html,text/css,application/javascript,application/json,image/svg+xml,application/xml,application/atom+xml diff --git a/deploy/podman/quadlet/grimmory.container b/deploy/podman/quadlet/grimmory.container index b6afbee51..0f6378dcd 100644 --- a/deploy/podman/quadlet/grimmory.container +++ b/deploy/podman/quadlet/grimmory.container @@ -20,7 +20,7 @@ Environment=TZ=Etc/UTC Secret=grimmory_db_pass,type=env,target=DATABASE_PASSWORD Environment=DATABASE_URL=jdbc:mariadb://localhost:3306/grimmory Environment=DATABASE_USERNAME=grimmory -HealthCmd=CMD-SHELL wget -q --spider http://localhost:${BOOKLORE_PORT:-6060}/api/v1/healthcheck +HealthCmd=CMD-SHELL wget -q --spider http://localhost:${SERVER_PORT:-6060}/api/v1/healthcheck HealthInterval=1m HealthRetries=5 HealthStartPeriod=1m