Bereite Docusaurus-Deploy mit Docker und eigener Docs-Site vor

This commit is contained in:
2026-04-21 19:45:16 +02:00
parent 8114a8c645
commit 1637d4bd91
12 changed files with 282 additions and 0 deletions

4
docs-site/.dockerignore Normal file
View File

@@ -0,0 +1,4 @@
node_modules
build
.docusaurus
.git

17
docs-site/Dockerfile Normal file
View File

@@ -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;"]

51
docs-site/README.md Normal file
View File

@@ -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`)

View File

@@ -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;

16
docs-site/nginx.conf Normal file
View File

@@ -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";
}
}

30
docs-site/package.json Normal file
View File

@@ -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"
}
}

7
docs-site/sidebars.ts Normal file
View File

@@ -0,0 +1,7 @@
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';
const sidebars: SidebarsConfig = {
docsSidebar: [{ type: 'autogenerated', dirName: '.' }],
};
export default sidebars;

View File

@@ -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;
}

View File

@@ -0,0 +1,20 @@
import Link from '@docusaurus/Link';
import Layout from '@theme/Layout';
export default function Home(): JSX.Element {
return (
<Layout title="FEDEO Docs" description="Versionierte Funktionsdokumentation für FEDEO">
<main className="heroSection">
<div className="container">
<h1>FEDEO Dokumentation</h1>
<p>Versionierte Anleitung aller Funktionen für Backend, Web und Mobile.</p>
<div className="heroButtons">
<Link className="button button--primary button--lg" to="/docs/funktionen">
Zur Dokumentation
</Link>
</div>
</div>
</main>
</Layout>
);
}

View File

7
docs-site/tsconfig.json Normal file
View File

@@ -0,0 +1,7 @@
{
"extends": "@docusaurus/tsconfig",
"compilerOptions": {
"baseUrl": "."
},
"exclude": ["build", "node_modules"]
}