FROM node:22-alpine # Install git (required by asyncapi html-template installer) RUN apk add --no-cache git # Install pnpm RUN npm install -g pnpm@10.33.0 # Install AsyncAPI CLI and Redocly CLI for docs generation RUN npm install -g @asyncapi/cli@6.0.0 @redocly/cli # Pre-cache the AsyncAPI html-template so generation works on first startup RUN mkdir -p /tmp/asyncapi-warmup /tmp/asyncapi-warmup/out && \ printf 'asyncapi: "3.0.0"\ninfo:\n title: Warmup\n version: "1.0.0"\nchannels: {}\n' \ > /tmp/asyncapi-warmup/spec.yaml && \ asyncapi generate fromTemplate /tmp/asyncapi-warmup/spec.yaml @asyncapi/html-template \ --output /tmp/asyncapi-warmup/out --no-interactive --install --force-write 2>&1 || true && \ rm -rf /tmp/asyncapi-warmup WORKDIR /workspace EXPOSE 3000 CMD ["pnpm", "run", "start:dev"]