Files
Jyotisha/deploy/railway-web.Dockerfile
T
ClaudeandClaude Opus 5.5 0f1c179eb6
Independent Staging Quality Gate / validate (push) Successful in 16m19s
Independent Staging Quality Gate / publish (push) Successful in 6m6s
fix(deploy): web image installs packages from npmmirror like the gate (BUG-1503)
Publish job 11273 and its rerun 11284 timed out fetching from
registry.npmjs.org (zwitch, then zustand) while every validate check passed.
The gate's own install already uses registry.npmmirror.com; the image's npm ci
now does too. The lock file pins versions and integrity hashes, so the
installed packages are unchanged. Approved by the product owner 2026-11-01.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyeZrYn6ryNcSe5Y2Y
2026-11-01 22:39:53 +08:00

62 lines
2.5 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 ./
# Same registry as the quality gate's own install: the build host times out on
# registry.npmjs.org (BUG-1503). The lock file pins every version and integrity
# hash, so the installed packages are identical.
ARG NPM_CONFIG_REGISTRY=https://registry.npmmirror.com
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"]