File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ RUN rm -rf orval.config.ts cypress.config.ts cypress/ docs/ scripts/ lighthouse-
1919FROM gcr.io/distroless/nodejs24-debian13 AS runner
2020
2121WORKDIR /opt/app
22+ ARG APP_VERSION
2223ENV NODE_ENV=production
24+ ENV APP_VERSION=${APP_VERSION}
2325
2426COPY --from=builder --chown=nonroot:nonroot /opt/app/next.config.js ./
2527COPY --from=builder --chown=nonroot:nonroot /opt/app/public ./public
Original file line number Diff line number Diff line change 1+ export const dynamic = 'force-dynamic'
2+
3+ const internalHost = 'hypixel-react.sky.svc.cluster.local'
4+
5+ export function GET ( request : Request ) {
6+ const host = request . headers . get ( 'host' ) ?. split ( ':' ) [ 0 ]
7+ if ( host !== internalHost ) return new Response ( null , { status : 404 } )
8+
9+ const version = process . env . APP_VERSION ?? ''
10+ if ( ! / ^ [ a - f 0 - 9 ] { 40 } $ / i. test ( version ) ) return new Response ( 'APP_VERSION is not configured' , { status : 503 } )
11+
12+ return new Response ( version , {
13+ headers : {
14+ 'Cache-Control' : 'no-store' ,
15+ 'Content-Type' : 'text/plain; charset=utf-8'
16+ }
17+ } )
18+ }
You can’t perform that action at this time.
0 commit comments