# Fallback only — see go-Dockerfile's header comment for the general
# rule, including the Harbor base-images sourcing (also applies here).
# Simplified from the real node-Dockerfile: no PBAC registry sync,
# no inline Sonar/coverage stage, no .npmrc-across-subdirectories dance.
# Assumes a standard `npm run build` + `npm start` repo. Switched from
# node:*-slim (Debian) to node:*-alpine for both stages — smaller, still
# keeps a shell for kubectl exec debugging (not distroless).
FROM harbor.192.168.1.7.nip.io/base-images/node:${version}-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build --if-present

FROM harbor.192.168.1.7.nip.io/base-images/node:${version}-alpine
WORKDIR /app
COPY --from=build /app .
ENV NODE_ENV=production
EXPOSE 8080
CMD ["npm", "start"]
