Feature 4: Webinterface — React-Frontend, Discord-OAuth2, REST-API
- Discord-OAuth2-Login (identify-Scope, CSRF-State, signierte Session-Cookies, keine Token-Speicherung) - REST-API: /api/devlogs (öffentlich), /api/commits (nur ADMIN_DISCORD_ID), /api/me - React + Vite Frontend: Devlog-Archiv mit Mini-Markdown-Renderer, Commit-Tabelle, dunkles EcoGame-Theme - Fastify liefert frontend/dist mit SPA-Fallback aus; Vite-Dev-Proxy für lokale Entwicklung - Multi-Stage-Dockerfile (Frontend-Build im Image), neue Env-Vars in Compose + .env.example - README: OAuth2-Setup (Redirect-URLs, Client Secret) und Frontend-Workflow Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+12
-3
@@ -1,5 +1,13 @@
|
||||
# EcoBot — Discord-Bot + (später) Webinterface
|
||||
# slim statt alpine: better-sqlite3 liefert glibc-Prebuilds → kein Compiler im Image nötig
|
||||
# EcoBot — Discord-Bot + Webinterface
|
||||
# Stage 1: React-Frontend bauen
|
||||
FROM node:22-slim AS frontend
|
||||
WORKDIR /build
|
||||
COPY frontend/package.json frontend/package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY frontend ./
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Runtime (slim statt alpine: better-sqlite3 liefert glibc-Prebuilds)
|
||||
FROM node:22-slim
|
||||
|
||||
WORKDIR /app
|
||||
@@ -9,8 +17,9 @@ COPY package.json package-lock.json ./
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
COPY src ./src
|
||||
COPY --from=frontend /build/dist ./frontend/dist
|
||||
|
||||
# Laufzeitdaten (SQLite ab Feature 2) landen in /app/data → Volume
|
||||
# Laufzeitdaten (SQLite) landen in /app/data → Volume
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
Reference in New Issue
Block a user