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>
13 lines
301 B
Docker
13 lines
301 B
Docker
FROM node:22-alpine AS build
|
|
WORKDIR /app
|
|
COPY package.json .
|
|
RUN npm install
|
|
COPY . .
|
|
ARG VITE_HOTEL_NAME
|
|
ENV VITE_HOTEL_NAME=$VITE_HOTEL_NAME
|
|
RUN npm run build
|
|
|
|
FROM nginx:alpine
|
|
COPY --from=build /app/dist /usr/share/nginx/html/room-planner
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
EXPOSE 80
|