Updated docker

This commit is contained in:
2026-09-03 10:40:55 +00:00
parent 09cbe61890
commit c121e0ca0a
5 changed files with 100 additions and 121 deletions
+16 -1
View File
@@ -34,6 +34,21 @@ collection links point there. All product photography is self-hosted under
```bash
npm run dev # vite dev server (port 3000)
npm run build # production build to dist/
npm run start # serve the production build (vite preview)
npm start # serve the production build (node server.mjs)
npm run preview # serve the production build via vite preview
npm run lint # eslint
```
## Docker
```bash
docker build -t mozimo-web .
docker run -p 3000:3000 mozimo-web
```
Three-stage build (`deps → builder → runner`) on pinned `node:24-trixie-slim`:
dependencies install with `npm ci` and BuildKit cache mounts, the final image
runs as the unprivileged `node` user, ships only production dependencies plus
the build output and a small Node server (`server.mjs`: static assets with
immutable caching + gzip, SSR fetch-handler fallback, graceful shutdown), and
includes a `HEALTHCHECK`. `.dockerignore` keeps build context minimal.