Public, statically generated knowledge pages from the approved prototype: /learn lists 全部 plus seven columns with question titles and one-line summaries (a sideways row on phones); /learn/<column>/<slug> renders the question, the one-line answer, reviewer and date (or 「初稿 · 待占星师审校」), the Markdown body, 「我们采用的口径」, 「在 Jyotisha 里看」, 「接着读」 and 参考出处. Articles are frontend/content/learn/*.md with the frontmatter template from the issue, read by a small parser and validated with zod; a bad file fails the tests and next build with the file name and a reason. Drafts are readable but noindex and stay out of sitemap.xml. robots.txt opens only production. The web image copies frontend/content before the build. Ships the one example article 「生时校正能做到多准?」 as an unsigned draft. The chart page's ascendant line links it while the ascendant can still change, through a 盘面要素 → 文章 table that only links existing articles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DbBXoyeZrYn6ryNcSe5Y2Y
58 lines
2.2 KiB
Docker
58 lines
2.2 KiB
Docker
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/node:22-alpine AS build
|
|
|
|
WORKDIR /app/frontend
|
|
COPY frontend/package.json frontend/package-lock.json ./
|
|
RUN npm ci
|
|
|
|
COPY frontend/src ./src
|
|
COPY frontend/public ./public
|
|
# 印度占星知识 Markdown (issue #157); read by `next build`, which prerenders /learn.
|
|
COPY frontend/content ./content
|
|
COPY frontend/next.config.ts frontend/postcss.config.mjs frontend/tsconfig.json ./
|
|
COPY frontend/scripts ./scripts
|
|
COPY frontend/db ./db
|
|
COPY frontend/supabase/migrations ./supabase/migrations
|
|
|
|
ARG NEXT_DEPLOYMENT_ID
|
|
ARG NEXT_PUBLIC_SUPABASE_URL
|
|
ARG NEXT_PUBLIC_SUPABASE_ANON_KEY
|
|
ENV NEXT_DEPLOYMENT_ID=${NEXT_DEPLOYMENT_ID} \
|
|
NEXT_PUBLIC_GIT_COMMIT=${NEXT_DEPLOYMENT_ID} \
|
|
NEXT_PUBLIC_SUPABASE_URL=${NEXT_PUBLIC_SUPABASE_URL} \
|
|
NEXT_PUBLIC_SUPABASE_ANON_KEY=${NEXT_PUBLIC_SUPABASE_ANON_KEY}
|
|
COPY SKILL.md /app/SKILL.md
|
|
COPY assets /app/assets
|
|
COPY references /app/references
|
|
COPY scripts /app/scripts
|
|
COPY skills /app/skills
|
|
|
|
RUN npm run build
|
|
|
|
# File tracing pulls skills/ into the standalone bundle with symlinks resolved into
|
|
# real directories, which then collides with the explicit COPY in the final stage.
|
|
RUN rm -rf /app/frontend/.next/standalone/skills
|
|
|
|
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/node:22-alpine
|
|
|
|
WORKDIR /app/frontend
|
|
COPY --from=build /app/frontend/.next/standalone /app
|
|
COPY --from=build /app/frontend/.next/static /app/frontend/.next/static
|
|
COPY --from=build /app/frontend/public /app/frontend/public
|
|
COPY --from=build /app/frontend/db /app/frontend/db
|
|
COPY --from=build /app/frontend/supabase/migrations /app/frontend/supabase/migrations
|
|
# Live consult skill entries are git-tracked relative symlinks into /app.
|
|
COPY --from=build /app/SKILL.md /app/SKILL.md
|
|
COPY --from=build /app/assets /app/assets
|
|
COPY --from=build /app/references /app/references
|
|
COPY --from=build /app/scripts /app/scripts
|
|
COPY --from=build /app/skills /app/skills
|
|
|
|
ARG NEXT_PUBLIC_SUPABASE_URL
|
|
ARG NEXT_PUBLIC_SUPABASE_ANON_KEY
|
|
ENV NEXT_PUBLIC_SUPABASE_URL=${NEXT_PUBLIC_SUPABASE_URL} \
|
|
NEXT_PUBLIC_SUPABASE_ANON_KEY=${NEXT_PUBLIC_SUPABASE_ANON_KEY}
|
|
ENV NODE_ENV=production \
|
|
HOSTNAME=0.0.0.0 \
|
|
JYOTISHA_PROJECT_ROOT=/app
|
|
CMD ["node", "server.js"]
|