FROM node:20-alpine AS builder
WORKDIR /app/docs-site

COPY docs-site/package.json docs-site/package-lock.json ./
RUN npm ci

COPY docs-site ./
COPY docs /app/docs

RUN npm run build

FROM node:20-alpine AS runner
WORKDIR /app/docs-site
ENV NODE_ENV=production

COPY --from=builder /app/docs-site/.output ./.output

EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]
