- 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>
28 lines
658 B
Docker
28 lines
658 B
Docker
# 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
|
|
|
|
# Erst nur Manifest kopieren → Docker-Layer-Cache für npm ci
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --omit=dev
|
|
|
|
COPY src ./src
|
|
COPY --from=frontend /build/dist ./frontend/dist
|
|
|
|
# Laufzeitdaten (SQLite) landen in /app/data → Volume
|
|
RUN mkdir -p /app/data
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
CMD ["node", "src/index.js"]
|