cards/apps/web/Dockerfile
Till JS 045903b5b9
Some checks are pending
CI / validate (push) Waiting to run
Phase 10a: Production-Deploy-Stack (Mac Mini)
infrastructure/docker-compose.production.yml mit 4 Services:
  - cards-postgres :5436    (Plattform-Postgres :5432, Dev :5435 belegt)
  - cards-minio :9110/9111  (Plattform-MinIO :9000/9001 belegt)
  - cards-api :3091         (alt war :3072 — Cutover via Tunnel-Reroute)
  - cards-web :5181         (alt war :5180)

Persistente Volumes auf /Volumes/ManaData/cards/{postgres,minio} —
außerhalb des Repo-Verzeichnisses (überlebt repo-wipes, gleicher
Pfad wie mana-platform-Daten).

Dockerfiles:
  - apps/api: oven/bun:1.1-alpine, single-stage. pnpm via npm install.
    Verdaccio-Auth via NPM_AUTH_TOKEN-Build-Arg + .npmrc.
  - apps/web: 2-stage node:20-alpine. SvelteKit-build mit
    PUBLIC_CARDS_API_URL als Build-Arg (kommt direkt in den
    Client-Bundle via vite). Runtime startet adapter-node-Bundle
    direkt mit `node build/index.js`.

infrastructure/.env.production.example als committable Skeleton —
echte .env.production bleibt git-ignored. Vier Secrets nötig:
CARDS_DB_PASSWORD, CARDS_S3_SECRET_KEY, CARDS_DSGVO_SERVICE_KEY,
NPM_AUTH_TOKEN.

Hard-Cutover-Plan: alte mana-app-cards-{server,web} bleiben kurz
parallel laufend, Tunnel zeigt nach dem Build/Verify-Cycle auf die
neuen Container, dann werden die alten gestoppt + entfernt.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 20:09:19 +02:00

44 lines
1.1 KiB
Docker

# Cards-Web: SvelteKit (adapter-node), 2-stage build.
# Build-Context = Repo-Root.
FROM node:20-alpine AS builder
WORKDIR /app
ARG NPM_AUTH_TOKEN
ENV NPM_AUTH_TOKEN=${NPM_AUTH_TOKEN}
ARG PUBLIC_CARDS_API_URL
ENV PUBLIC_CARDS_API_URL=${PUBLIC_CARDS_API_URL}
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml turbo.json .npmrc ./
COPY apps/web/package.json apps/web/
COPY packages/cards-domain/package.json packages/cards-domain/
RUN npm install -g pnpm@9.15.9 \
&& pnpm install --frozen-lockfile --prod=false
COPY packages/cards-domain packages/cards-domain
COPY apps/web apps/web
WORKDIR /app/apps/web
RUN pnpm exec svelte-kit sync && pnpm exec vite build
# --- runtime stage ---
FROM node:20-alpine AS runtime
WORKDIR /app
# adapter-node bundled das complete server-bundle in build/, sonst nichts.
COPY --from=builder /app/apps/web/build /app/build
COPY --from=builder /app/apps/web/package.json /app/package.json
# adapter-node hat keine externen Deps zur Laufzeit (alles ist in build/
# gebundelt), wir starten direkt mit node.
ENV NODE_ENV=production
ENV PORT=3000
ENV HOST=0.0.0.0
EXPOSE 3000
CMD ["node", "build/index.js"]