Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .prod/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ http {
}

location /readiness {
return 200 'OK';
add_header Content-Type application/json;
add_header Cache-Control "no-cache, no-store, must-revalidate";
return 200 '{"status": "ok", "release": "${REACT_APP_RELEASE}", "packageVersion": "${APP_VERSION}"}';
}

location / {
Expand Down
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,17 @@ FROM appbase as staticbuilder

WORKDIR /app

ARG REACT_APP_SENTRY_RELEASE

ENV REACT_APP_RELEASE=${REACT_APP_SENTRY_RELEASE:-""}

RUN yarn build

# Process nginx configuration with APP_VERSION substitution
COPY .prod/nginx.conf /app/nginx.conf.template
RUN export APP_VERSION=$(yarn --silent app:version | tr -d '\n') && \
envsubst '${APP_VERSION},${REACT_APP_RELEASE}' < /app/nginx.conf.template > /app/nginx.conf

# =============================
FROM registry.access.redhat.com/ubi9/nginx-122 as production
# =============================
Expand All @@ -71,8 +80,8 @@ RUN chgrp -R 0 /usr/share/nginx/html && \
# Copy static build
COPY --from=staticbuilder /app/build /usr/share/nginx/html

# Copy nginx config
COPY .prod/nginx.conf /etc/nginx/nginx.conf
# Copy processed nginx config from build stage
COPY --from=staticbuilder /app/nginx.conf /etc/nginx/nginx.conf
RUN mkdir /etc/nginx/env
COPY .prod/nginx_env.conf /etc/nginx/env/

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"node": ">=22.13.1"
},
"scripts": {
"app:version": "echo \"$npm_package_version\"",
"start": "if test $NODE_MAX_MEMORY_MIB ; then node --max-old-space-size=$NODE_MAX_MEMORY_MIB yarn clear-babel-cache && yarn update-runtime-env && vite ; else yarn clear-babel-cache && yarn update-runtime-env && vite ; fi",
"build": "vite build",
"serve": "vite preview",
Expand Down
Loading