| 1 | # Repo explorer + document host for the Property Ontology. |
| 2 | # Build context is the repository root so the whole repo is available to browse. |
| 3 | FROM node:22-alpine AS deps |
| 4 | WORKDIR /app/explorer |
| 5 | COPY explorer/package.json explorer/package-lock.json* ./ |
| 6 | RUN npm ci --omit=dev --no-audit --no-fund |
| 7 | |
| 8 | FROM node:22-alpine |
| 9 | ENV NODE_ENV=production \ |
| 10 | REPO_ROOT=/repo \ |
| 11 | PORT=3000 |
| 12 | WORKDIR /app/explorer |
| 13 | COPY --from=deps /app/explorer/node_modules ./node_modules |
| 14 | COPY explorer/ ./ |
| 15 | # The browsable repository (excludes .git, .env*, node_modules via .dockerignore) |
| 16 | COPY . /repo |
| 17 | RUN rm -rf /repo/explorer/node_modules |
| 18 | USER node |
| 19 | EXPOSE 3000 |
| 20 | HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \ |
| 21 | CMD wget -qO- http://127.0.0.1:${PORT}/healthz || exit 1 |
| 22 | CMD ["node", "server.js"] |