mirror of
https://github.com/andwati/andwati.com.git
synced 2026-10-31 06:42:16 +00:00
Replace Astro/Strapi site with Next.js static export
- Fresh structure: Next.js App Router + Tailwind v4 at the repo root, exported as static files (output: export) and served by static-web-server - Remove the Strapi CMS, Astro app, Pagefind search, comments, old scripts, Lighthouse config and compose files; content in content/ is now plain markdown with YAML frontmatter - Pages: About, Writing, Reading (3D bookshelf) and Portfolio, styled after adammaj.com - SEO: metadata and canonicals, JSON-LD, generated OG images, sitemap, robots, RSS and JSON feeds, llms.txt - Umami via PUBLIC_UMAMI_SCRIPT_URL / PUBLIC_UMAMI_WEBSITE_ID (build args) - Dockerfile builds the export and serves it with sws.toml (security headers, clean URLs, .well-known, OG image content type, immutable asset caching) - Prettier and cspell for content with a husky/lint-staged pre-commit hook - Old redirect list dropped to start from a clean slate
This commit is contained in:
+22
-12
@@ -1,20 +1,30 @@
|
||||
# Production image for the Astro site. Build from the workspace root:
|
||||
# docker build -t andwati-site .
|
||||
# syntax=docker/dockerfile:1
|
||||
# Static site: build with Next (output: export), serve with static-web-server.
|
||||
# docker build -t andwati-site \
|
||||
# --build-arg PUBLIC_UMAMI_SCRIPT_URL=... --build-arg PUBLIC_UMAMI_WEBSITE_ID=... .
|
||||
|
||||
FROM node:24-bookworm-slim AS build
|
||||
FROM node:24-alpine AS deps
|
||||
ENV PNPM_HOME=/pnpm PATH=/pnpm:$PATH
|
||||
RUN corepack enable
|
||||
WORKDIR /app
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
COPY pnpm-workspace.yaml pnpm-lock.yaml package.json ./
|
||||
COPY apps/site/package.json apps/site/package.json
|
||||
COPY apps/cms/package.json apps/cms/package.json
|
||||
COPY apps/site apps/site
|
||||
COPY content content
|
||||
COPY scripts scripts
|
||||
RUN pnpm install --frozen-lockfile --filter andwati-com --filter site
|
||||
RUN pnpm --filter site build
|
||||
FROM node:24-alpine AS build
|
||||
ENV PNPM_HOME=/pnpm PATH=/pnpm:$PATH NEXT_TELEMETRY_DISABLED=1
|
||||
RUN corepack enable
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
# Umami is read at build time (pages are prerendered), so pass these as build args.
|
||||
ARG PUBLIC_UMAMI_SCRIPT_URL
|
||||
ARG PUBLIC_UMAMI_WEBSITE_ID
|
||||
ENV PUBLIC_UMAMI_SCRIPT_URL=$PUBLIC_UMAMI_SCRIPT_URL \
|
||||
PUBLIC_UMAMI_WEBSITE_ID=$PUBLIC_UMAMI_WEBSITE_ID
|
||||
RUN pnpm build
|
||||
|
||||
FROM ghcr.io/static-web-server/static-web-server:2
|
||||
COPY --from=build /app/apps/site/dist /public
|
||||
COPY --from=build /app/out /public
|
||||
COPY sws.toml /sws.toml
|
||||
EXPOSE 80
|
||||
|
||||
Reference in New Issue
Block a user