Files
Siteforge/Dockerfile
T
nmemmertandClaude Sonnet 4.6 65623ce0eb
Publish Container / docker (push) Successful in 14m11s
Wire up deployment metadata: build commit, number, and server start time; v2.0.30
- Dockerfile: expose BUILD_COMMIT and BUILD_NUMBER env vars from build args
  (was COMMIT_SHA only; server was reading BUILD_COMMIT so it always fell through to null)
- CI: pass github.run_number as BUILD_NUMBER build arg
- state.js: record serverStartedAt at module load so deployedAt always shows
  when the current container instance came up, even without an env var
- admin-content.js: fall back COMMIT_SHA → BUILD_COMMIT for older images,
  use state.serverStartedAt when DEPLOYED_AT env var not set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-09-17 16:52:44 -04:00

39 lines
1012 B
Docker

# Install prod deps on the native builder platform to avoid QEMU npm crashes
# during cross-platform builds. All deps are pure-JS so this is safe.
FROM --platform=$BUILDPLATFORM node:22-alpine AS deps
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev --legacy-peer-deps
FROM node:22-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=4173
ARG COMMIT_SHA=unknown
ARG BUILD_NUMBER=unknown
ENV BUILD_COMMIT=${COMMIT_SHA}
ENV BUILD_NUMBER=${BUILD_NUMBER}
COPY --from=deps /app/node_modules ./node_modules
COPY package.json ./package.json
COPY dist ./dist
COPY server.js ./server.js
COPY server/ ./server/
COPY shared/ ./shared/
COPY A_Study_of_Titus.pdf ./A_Study_of_Titus.pdf
# Copy seed data to a separate directory so the entrypoint can seed /app/data
# only when no live data exists yet — upgrades never overwrite existing data.
COPY data ./data-seed
RUN mkdir -p /app/data
COPY entrypoint.sh ./entrypoint.sh
RUN chmod +x ./entrypoint.sh
EXPOSE 4173
ENTRYPOINT ["./entrypoint.sh"]