From 1637d4bd91dbb20359f6733755070abcc89a9658 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Tue, 21 Apr 2026 19:45:16 +0200 Subject: [PATCH] Bereite Docusaurus-Deploy mit Docker und eigener Docs-Site vor --- docker-compose.docs.yml | 9 ++++ docs-site/.dockerignore | 4 ++ docs-site/Dockerfile | 17 +++++++ docs-site/README.md | 51 ++++++++++++++++++++ docs-site/docusaurus.config.ts | 85 ++++++++++++++++++++++++++++++++++ docs-site/nginx.conf | 16 +++++++ docs-site/package.json | 30 ++++++++++++ docs-site/sidebars.ts | 7 +++ docs-site/src/css/custom.css | 36 ++++++++++++++ docs-site/src/pages/index.tsx | 20 ++++++++ docs-site/static/img/.gitkeep | 0 docs-site/tsconfig.json | 7 +++ 12 files changed, 282 insertions(+) create mode 100644 docker-compose.docs.yml create mode 100644 docs-site/.dockerignore create mode 100644 docs-site/Dockerfile create mode 100644 docs-site/README.md create mode 100644 docs-site/docusaurus.config.ts create mode 100644 docs-site/nginx.conf create mode 100644 docs-site/package.json create mode 100644 docs-site/sidebars.ts create mode 100644 docs-site/src/css/custom.css create mode 100644 docs-site/src/pages/index.tsx create mode 100644 docs-site/static/img/.gitkeep create mode 100644 docs-site/tsconfig.json diff --git a/docker-compose.docs.yml b/docker-compose.docs.yml new file mode 100644 index 0000000..00f2f40 --- /dev/null +++ b/docker-compose.docs.yml @@ -0,0 +1,9 @@ +services: + docs: + build: + context: . + dockerfile: docs-site/Dockerfile + container_name: fedeo-docs + restart: unless-stopped + ports: + - "3205:80" diff --git a/docs-site/.dockerignore b/docs-site/.dockerignore new file mode 100644 index 0000000..0e9db65 --- /dev/null +++ b/docs-site/.dockerignore @@ -0,0 +1,4 @@ +node_modules +build +.docusaurus +.git diff --git a/docs-site/Dockerfile b/docs-site/Dockerfile new file mode 100644 index 0000000..5aa1582 --- /dev/null +++ b/docs-site/Dockerfile @@ -0,0 +1,17 @@ +FROM node:20-alpine AS builder +WORKDIR /app/docs-site + +COPY docs-site/package.json docs-site/package-lock.json* ./ +RUN npm install + +COPY docs-site ./ +COPY docs /app/docs + +RUN npm run build + +FROM nginx:1.27-alpine AS runner +COPY docs-site/nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=builder /app/docs-site/build /usr/share/nginx/html + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/docs-site/README.md b/docs-site/README.md new file mode 100644 index 0000000..11dbc1e --- /dev/null +++ b/docs-site/README.md @@ -0,0 +1,51 @@ +# FEDEO Docs Site (Docusaurus) + +Diese Docusaurus-App rendert die versionierte FEDEO-Dokumentation aus dem Ordner `../docs`. + +## Lokale Entwicklung + +Im Ordner `docs-site` ausführen: + +```bash +npm install +npm run start +``` + +Danach ist die Seite unter `http://localhost:3005` erreichbar. + +## Statischer Build + +```bash +npm run build +npm run serve +``` + +## Deploy mit Docker Compose + +Aus dem Projekt-Root: + +```bash +docker compose -f docker-compose.docs.yml up -d --build +``` + +Standard-Port ist `3205`. + +## Workflow bei Funktionsänderungen + +Vor jedem Docs-Deploy: + +1. Technische Kataloge aktualisieren + +```bash +node docs/scripts/sync-funktionsdoku.mjs +``` + +2. Änderungen committen +3. Docs-Container neu bauen und starten + +## Wichtige Platzhalter + +Bitte in `docs-site/docusaurus.config.ts` anpassen: + +- `url` auf die echte Docs-Domain +- GitHub-Links (`editUrl`, `Repository`) diff --git a/docs-site/docusaurus.config.ts b/docs-site/docusaurus.config.ts new file mode 100644 index 0000000..ef2cb80 --- /dev/null +++ b/docs-site/docusaurus.config.ts @@ -0,0 +1,85 @@ +import type { Config } from '@docusaurus/types'; +import { themes as prismThemes } from 'prism-react-renderer'; + +const config: Config = { + title: 'FEDEO Docs', + tagline: 'Versionierte Funktionsdokumentation für FEDEO', + + url: 'https://docs.example.com', + baseUrl: '/', + + onBrokenLinks: 'throw', + onBrokenMarkdownLinks: 'warn', + + i18n: { + defaultLocale: 'de', + locales: ['de'], + }, + + presets: [ + [ + 'classic', + { + docs: { + path: '../docs', + routeBasePath: 'docs', + sidebarPath: './sidebars.ts', + editUrl: 'https://github.com/DEIN-ORG/DEIN-REPO/tree/main/', + }, + blog: false, + theme: { + customCss: './src/css/custom.css', + }, + }, + ], + ], + + themeConfig: { + navbar: { + title: 'FEDEO Docs', + items: [ + { + type: 'docSidebar', + sidebarId: 'docsSidebar', + position: 'left', + label: 'Dokumentation', + }, + { + href: 'https://github.com/DEIN-ORG/DEIN-REPO', + label: 'GitHub', + position: 'right', + }, + ], + }, + footer: { + style: 'dark', + links: [ + { + title: 'Dokumentation', + items: [ + { + label: 'Funktionsübersicht', + to: '/docs/funktionen/uebersicht', + }, + ], + }, + { + title: 'Projekt', + items: [ + { + label: 'Repository', + href: 'https://github.com/DEIN-ORG/DEIN-REPO', + }, + ], + }, + ], + copyright: `Copyright © ${new Date().getFullYear()} FEDEO`, + }, + prism: { + theme: prismThemes.github, + darkTheme: prismThemes.dracula, + }, + }, +}; + +export default config; diff --git a/docs-site/nginx.conf b/docs-site/nginx.conf new file mode 100644 index 0000000..61cb853 --- /dev/null +++ b/docs-site/nginx.conf @@ -0,0 +1,16 @@ +server { + listen 80; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location ~* \.(?:css|js|map|jpg|jpeg|gif|png|svg|ico|webp|woff2?)$ { + expires 30d; + add_header Cache-Control "public, immutable"; + } +} diff --git a/docs-site/package.json b/docs-site/package.json new file mode 100644 index 0000000..4c8be61 --- /dev/null +++ b/docs-site/package.json @@ -0,0 +1,30 @@ +{ + "name": "fedeo-docs-site", + "version": "1.0.0", + "private": true, + "scripts": { + "start": "docusaurus start --host 0.0.0.0 --port 3005", + "build": "docusaurus build", + "serve": "docusaurus serve --host 0.0.0.0 --port 3005", + "clear": "docusaurus clear", + "swizzle": "docusaurus swizzle", + "deploy": "docusaurus deploy" + }, + "dependencies": { + "@docusaurus/core": "3.9.2", + "@docusaurus/preset-classic": "3.9.2", + "clsx": "^2.1.1", + "prism-react-renderer": "^2.4.1", + "react": "^19.1.1", + "react-dom": "^19.1.1" + }, + "devDependencies": { + "typescript": "^5.8.3", + "@docusaurus/module-type-aliases": "3.9.2", + "@types/react": "^19.1.12", + "@types/react-dom": "^19.1.9" + }, + "engines": { + "node": ">=20.0" + } +} diff --git a/docs-site/sidebars.ts b/docs-site/sidebars.ts new file mode 100644 index 0000000..50299c2 --- /dev/null +++ b/docs-site/sidebars.ts @@ -0,0 +1,7 @@ +import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; + +const sidebars: SidebarsConfig = { + docsSidebar: [{ type: 'autogenerated', dirName: '.' }], +}; + +export default sidebars; diff --git a/docs-site/src/css/custom.css b/docs-site/src/css/custom.css new file mode 100644 index 0000000..c20ba78 --- /dev/null +++ b/docs-site/src/css/custom.css @@ -0,0 +1,36 @@ +:root { + --ifm-color-primary: #0b6e4f; + --ifm-color-primary-dark: #0a6348; + --ifm-color-primary-darker: #095d44; + --ifm-color-primary-darkest: #074c37; + --ifm-color-primary-light: #0c7956; + --ifm-color-primary-lighter: #0d7f5a; + --ifm-color-primary-lightest: #0f8f66; + --ifm-background-color: #f6f8f7; + --ifm-font-family-base: 'Atkinson Hyperlegible', 'Source Sans 3', system-ui, sans-serif; + --ifm-heading-font-family: 'IBM Plex Sans', 'Source Sans 3', system-ui, sans-serif; +} + +.heroSection { + min-height: calc(100vh - 60px); + display: grid; + place-items: center; + background: + radial-gradient(circle at 80% 20%, rgba(11, 110, 79, 0.2), transparent 40%), + radial-gradient(circle at 20% 80%, rgba(25, 130, 196, 0.2), transparent 35%), + linear-gradient(160deg, #eef6f3 0%, #f8faf9 100%); +} + +.heroSection h1 { + font-size: clamp(2rem, 6vw, 3.6rem); + margin-bottom: 0.75rem; +} + +.heroSection p { + font-size: clamp(1.05rem, 2.2vw, 1.35rem); + max-width: 680px; +} + +.heroButtons { + margin-top: 1.4rem; +} diff --git a/docs-site/src/pages/index.tsx b/docs-site/src/pages/index.tsx new file mode 100644 index 0000000..ad49a84 --- /dev/null +++ b/docs-site/src/pages/index.tsx @@ -0,0 +1,20 @@ +import Link from '@docusaurus/Link'; +import Layout from '@theme/Layout'; + +export default function Home(): JSX.Element { + return ( + +
+
+

FEDEO Dokumentation

+

Versionierte Anleitung aller Funktionen für Backend, Web und Mobile.

+
+ + Zur Dokumentation + +
+
+
+
+ ); +} diff --git a/docs-site/static/img/.gitkeep b/docs-site/static/img/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs-site/tsconfig.json b/docs-site/tsconfig.json new file mode 100644 index 0000000..ccaa2d6 --- /dev/null +++ b/docs-site/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "@docusaurus/tsconfig", + "compilerOptions": { + "baseUrl": "." + }, + "exclude": ["build", "node_modules"] +}