Deployment
This Docs Site

This Docs Site

The site you are reading is a Nextra 2 (Next.js, Pages Router) static export hosted on a private S3 bucket behind CloudFront — the same hosting pattern as the lk-wiz frontend.

Source

The site lives in docs-site/:

docs-site/
├── next.config.js      # output: 'export', trailingSlash: true, images.unoptimized
├── theme.config.jsx    # branding, nav, SEO
├── styles/custom.css   # lk-wiz brand colors
├── public/             # favicon.svg, logo.svg
└── pages/              # MDX/MD content + _meta.json nav files

Build it locally:

cd docs-site
npm install
npm run build   # static export to docs-site/out/

Hosting (docs Tofu stack)

The infrastructure/resources/aws/lkwiz/docs/ stack provisions:

  • a private S3 bucket (<project>-<stage>-docs) with SSE and a full public-access block — content is served only through CloudFront via Origin Access Control (OAC);
  • a CloudFront distributionPriceClass_100, redirect-to-https, TLS 1.2 (2021), compression, and a CloudFront Function that rewrites directory URIs to index.html (required for Next static-export nested paths on S3+OAC);
  • a custom response-headers policy that adds security headers plus a Content Security Policy suitable for a static Nextra build;
  • an ACM certificate in us-east-1 and, in dev, Route53 records (A/AAAA + ACM validation) written into the frontend-owned zone.

Unlike the SPA frontend (which serves index.html with a 200 for 403/404), the docs site is a real multi-page site: 403/404 are mapped to /404.html with a 404 status.

Domains

StageDocs URL
devhttps://docs.lkwiz-dev.copebit.ch
prodhttps://docs.lkwiz.copebit.ch

Deploying

Deployment mirrors the frontend: the manual deploy-docs-<stage> CI job (or scripts/deploy_hybrid.sh) builds docs-site/ and syncs out/ to the docs bucket with immutable caching for _next/static/* and no-cache for everything else, then invalidates CloudFront. See CI/CD.