chore: multi-stage Docker Needle build and trim MenuScene dist assets

Build MenuScene in Docker; ignore dist in context; remove bundled dist chunks;
update MenuScene index and MenuController bob defaults.

Made-with: Cursor
This commit is contained in:
pelpanagiotis
2026-04-20 07:46:34 +03:00
parent e2e5e47077
commit 3499f8257a
87 changed files with 24 additions and 45697 deletions

View File

@@ -1,13 +1,26 @@
# Serves pre-built Needle/Vite output from the repo (Needle/<app>/dist).
# Build locally first: cd Needle/MenuScene && npm run build
# Optional: Needle/SampleScene && npm run build (for compose profile "sample")
# Multi-stage: Vite production build runs during `docker build` / `docker compose build` —
# no `npm run build` on the host first. The final image is nginx + freshly built `dist/`.
#
# Unity still exports into Needle/<app>/assets/ on your machine; include that folder in the
# build context when it exists (it is not listed in .dockerignore). Clones without `assets/`
# need a Unity export (or committed assets) before the image can bundle a valid scene.
ARG NEEDLE_APP=MenuScene
FROM node:22-alpine AS builder
ARG NEEDLE_APP
WORKDIR /src
COPY Needle/${NEEDLE_APP}/package.json Needle/${NEEDLE_APP}/package-lock.json ./
RUN npm ci
COPY Needle/${NEEDLE_APP}/ ./
RUN npm run build
FROM nginx:1.27-alpine
ARG NEEDLE_APP
COPY Needle/${NEEDLE_APP}/dist /usr/share/nginx/html
COPY --from=builder /src/dist /usr/share/nginx/html
COPY docker/nginx-default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80