f43102b71a
Ein 'docker compose up' bringt die komplette Hosting-Plattform hoch: - include ../SERVER-CONTAINER (db/auth/rest/realtime/storage/kong/app) - host-db: eigene Postgres für RAPPORT-HOST - host: Node-Backend + gebündelte Hugo-Website (Dockerfile.host, multi-stage) provisioniert Kunden-Instanzen über Kong in den Supabase-Stack Eine .env für lokal UND Hetzner (Domains/Keys per Env). host-Image baut + läuft verifiziert: Website (/,/hosting/,/login/,/admin/) + API + E2E-Flow (register→checkout→admin) aus dem Container. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
32 lines
1.4 KiB
Docker
32 lines
1.4 KiB
Docker
# RAPPORT-HOST-Image — bündelt das Node-Backend MIT der gebauten Hugo-Website.
|
|
# Haupt-Build-Kontext: RAPPORT-HOST. Zusatz-Kontext `website`: RAPPORT-WEBSITE.
|
|
|
|
# ── Stage 1: Hugo-Website bauen ──────────────────────────────────────────────
|
|
FROM hugomods/hugo:exts AS web
|
|
WORKDIR /src
|
|
COPY --from=website . /src
|
|
# Frisch bauen (alte public/resources ignorieren), Ausgabe nach /public.
|
|
RUN rm -rf public resources && hugo --gc --baseURL / --destination /public
|
|
|
|
# ── Stage 2: Node-Backend ────────────────────────────────────────────────────
|
|
FROM node:20-alpine
|
|
WORKDIR /app
|
|
|
|
# Nur Server-Dependencies installieren (Layer-Caching).
|
|
COPY server/package.json server/package-lock.json* ./server/
|
|
RUN cd server && npm install --omit=dev --no-audit --no-fund
|
|
|
|
# Backend-Code + die gebaute Website.
|
|
COPY server ./server
|
|
COPY package.json ./
|
|
COPY --from=web /public ./website-public
|
|
|
|
# Das Backend liest WEBSITE_PUBLIC_DIR; hier auf die gebündelte Website zeigen.
|
|
ENV WEBSITE_PUBLIC_DIR=/app/website-public
|
|
ENV PORT=8787
|
|
EXPOSE 8787
|
|
|
|
# Beim Start: HOST-Schema migrieren, dann Server. (host-db ist via compose
|
|
# depends_on healthy.)
|
|
CMD ["sh", "-c", "node server/migrate.js && node server/index.js"]
|