# Fallback only — see go-Dockerfile's header comment for the general
# rule. 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.
FROM node:${version}-slim AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build --if-present

FROM node:${version}-slim
WORKDIR /app
COPY --from=build /app .
ENV NODE_ENV=production
EXPOSE 8080
CMD ["npm", "start"]
