fix: serve frontend via root + slug subdir, not alias — assets 404/fallback

nginx alias + try_files resolves paths incorrectly (nginx trac #97), so
asset requests fell through to the SPA fallback and index.html was served
as the JS bundle — the app never booted. Match the proven twin-optimiser
pattern: copy dist to html/room-planner and use root with try_files.
Also node:20 → node:22 per stack convention.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-03 16:32:45 +00:00
parent 5a2dab637c
commit a7cc79a9b1
2 changed files with 20 additions and 7 deletions

View file

@ -1,4 +1,4 @@
FROM node:20-alpine AS build
FROM node:22-alpine AS build
WORKDIR /app
COPY package.json .
RUN npm install
@ -8,6 +8,6 @@ ENV VITE_HOTEL_NAME=$VITE_HOTEL_NAME
RUN npm run build
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY --from=build /app/dist /usr/share/nginx/html/room-planner
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80