deploy without node
Some checks failed
ci / site (push) Has been cancelled
publish-image / publish (push) Has been cancelled

This commit is contained in:
2026-02-10 02:52:14 -05:00
parent 03df2b3a6c
commit 3b0b97f139
25 changed files with 312 additions and 51 deletions

View File

@@ -3,15 +3,31 @@ FROM node:24-alpine AS builder
WORKDIR /app/site
COPY site/package.json site/package-lock.json ./
RUN npm ci
RUN npm ci --no-audit --no-fund
COPY site/ ./
# Content is fetched before build (typically in CI) and committed into the build context at
# `site/content/cache/content.json`. If env vars aren't configured, the fetch step gracefully
# skips sources and/or uses last-known-good cache.
RUN npm run build
FROM nginx:1.27-alpine
ARG BUILD_SHA=unknown
ARG BUILD_DATE=unknown
ARG BUILD_REF=unknown
LABEL org.opencontainers.image.title="fast-website"
LABEL org.opencontainers.image.description="Lightweight, SEO-first static site packaged as an nginx image."
LABEL org.opencontainers.image.revision=$BUILD_SHA
LABEL org.opencontainers.image.created=$BUILD_DATE
LABEL org.opencontainers.image.source=$BUILD_REF
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /app/site/dist/ /usr/share/nginx/html/
EXPOSE 80
# Operator-friendly version visibility.
RUN printf '{\n "sha": "%s",\n "builtAt": "%s",\n "ref": "%s"\n}\n' "$BUILD_SHA" "$BUILD_DATE" "$BUILD_REF" \
> /usr/share/nginx/html/build.json
EXPOSE 80