Files
AR-Menu/Dockerfile
pelpanagiotis 3499f8257a 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
2026-04-20 07:46:34 +03:00

30 lines
978 B
Docker

# 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 --from=builder /src/dist /usr/share/nginx/html
COPY docker/nginx-default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD wget -q -O /dev/null http://127.0.0.1/ || exit 1