Commit Needle production dist and nginx-only Docker image

- Track Needle/MenuScene/dist and Needle/SampleScene/dist for container deploys
- Dockerfile copies pre-built dist (no npm in image); rebuild with npm run build before commit
- Fix Needle .gitignore: /assets/ so dist/assets is not ignored
- Git LFS: track *.wasm; relax .dockerignore so dist is sent as build context

Made-with: Cursor
This commit is contained in:
pelpanagiotis
2026-04-19 23:39:59 +03:00
parent 98062ef858
commit 6947303755
169 changed files with 91778 additions and 31 deletions

View File

@@ -1,29 +1,13 @@
# Needle Engine web export (Vite) → static nginx
#
# Prerequisites before `docker build`:
# - Export your scene from Unity so Needle/MenuScene (or SampleScene) contains:
# - src/generated/ (gen.js, register_types, etc.)
# - assets/ with your .glb and any files the Vite build copies
# - `npm run build` should succeed locally for the same NEEDLE_APP.
#
# Build needs network: Needle's build may verify license against needle.tools.
FROM node:22-alpine AS build
WORKDIR /build
# 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")
ARG NEEDLE_APP=MenuScene
ENV NEEDLE_APP=${NEEDLE_APP}
COPY Needle/${NEEDLE_APP}/package.json Needle/${NEEDLE_APP}/package-lock.json ./
RUN npm ci
FROM nginx:1.27-alpine
COPY Needle/${NEEDLE_APP}/ ./
RUN npm run build
FROM nginx:1.27-alpine AS runtime
COPY --from=build /build/dist /usr/share/nginx/html
ARG NEEDLE_APP
COPY Needle/${NEEDLE_APP}/dist /usr/share/nginx/html
COPY docker/nginx-default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80