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:
21
Dockerfile
21
Dockerfile
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user