# Stage 1: Build environment with HonKit
FROM node:20-alpine AS build

WORKDIR /book

# Install HonKit globally
RUN npm install -g honkit

# Copy GitBook source files
COPY book.json SUMMARY.md README.md faq.md ./
COPY introduction/ ./introduction/
COPY getting-started/ ./getting-started/
COPY mcp-tools/ ./mcp-tools/
COPY clients/ ./clients/
COPY project-management/ ./project-management/

# Build static HTML
RUN honkit build . /output

# Stage 2: Serve with nginx
FROM nginx:alpine

COPY --from=build /output /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80
