gwoe-antragspruefer/adr/0004-deployment-workflow/index.html

1155 lines
31 KiB
HTML

<!doctype html>
<html lang="de" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="https://docs.gwoe.toppyr.de/adr/0004-deployment-workflow/">
<link rel="prev" href="../0003-citation-property-tests/">
<link rel="next" href="../../archive/">
<link rel="icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.7.6">
<title>0004 Deployment-Workflow - GWÖ-Antragsprüfer Docs</title>
<link rel="stylesheet" href="../../assets/stylesheets/main.484c7ddc.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/palette.ab4e12ef.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="light-green">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#0004-docker-compose-deploy-mit-db-reports-volume-und-sn-xml-sonderpfad" class="md-skip">
Zum Inhalt
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Kopfzeile">
<a href="../.." title="GWÖ-Antragsprüfer Docs" class="md-header__button md-logo" aria-label="GWÖ-Antragsprüfer Docs" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
GWÖ-Antragsprüfer Docs
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
0004 Deployment-Workflow
</span>
</div>
</div>
</div>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Suche" placeholder="Suche" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
</label>
<nav class="md-search__options" aria-label="Suche">
<button type="reset" class="md-search__icon md-icon" title="Zurücksetzen" aria-label="Zurücksetzen" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
</button>
</nav>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Suche wird initialisiert
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://repo.toppyr.de/tobias/gwoe-antragspruefer" title="Zum Repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 41.8 9.1 55-6.4 6.4-15.2 10.1-24.3 10.1s-17.8-3.6-24.3-10.1c-17.6-17.6-11.1-46.9 11.2-56v-123c-20.8-8.5-24.6-30.7-18.6-45L142.6 101 8.5 235.1C3 240.6 0 247.9 0 255.5s3 15 8.5 20.4l195.6 195.7c5.4 5.4 12.7 8.4 20.4 8.4s15-3 20.4-8.4l194.7-194.7c5.4-5.4 8.4-12.8 8.4-20.4s-3-15-8.4-20.4"/></svg>
</div>
<div class="md-source__repository">
tobias/gwoe-antragspruefer
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../.." title="GWÖ-Antragsprüfer Docs" class="md-nav__button md-logo" aria-label="GWÖ-Antragsprüfer Docs" data-md-component="logo">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54"/></svg>
</a>
GWÖ-Antragsprüfer Docs
</label>
<div class="md-nav__source">
<a href="https://repo.toppyr.de/tobias/gwoe-antragspruefer" title="Zum Repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M439.6 236.1 244 40.5c-5.4-5.5-12.8-8.5-20.4-8.5s-15 3-20.4 8.4L162.5 81l51.5 51.5c27.1-9.1 52.7 16.8 43.4 43.7l49.7 49.7c34.2-11.8 61.2 31 35.5 56.7-26.5 26.5-70.2-2.9-56-37.3L240.3 199v121.9c25.3 12.5 22.3 41.8 9.1 55-6.4 6.4-15.2 10.1-24.3 10.1s-17.8-3.6-24.3-10.1c-17.6-17.6-11.1-46.9 11.2-56v-123c-20.8-8.5-24.6-30.7-18.6-45L142.6 101 8.5 235.1C3 240.6 0 247.9 0 255.5s3 15 8.5 20.4l195.6 195.7c5.4 5.4 12.7 8.4 20.4 8.4s15-3 20.4-8.4l194.7-194.7c5.4-5.4 8.4-12.8 8.4-20.4s-3-15-8.4-20.4"/></svg>
</div>
<div class="md-source__repository">
tobias/gwoe-antragspruefer
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../.." class="md-nav__link">
<span class="md-ellipsis">
Start
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" checked>
<label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="">
<span class="md-ellipsis">
Architecture Decision Records
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Architecture Decision Records
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../" class="md-nav__link">
<span class="md-ellipsis">
Übersicht
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../0001-llm-citation-binding/" class="md-nav__link">
<span class="md-ellipsis">
0001 LLM-Citation-Binding
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../0002-adapter-architecture/" class="md-nav__link">
<span class="md-ellipsis">
0002 Adapter-Architektur
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../0003-citation-property-tests/" class="md-nav__link">
<span class="md-ellipsis">
0003 Citation-Property-Tests
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
0004 Deployment-Workflow
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
0004 Deployment-Workflow
</span>
</a>
<nav class="md-nav md-nav--secondary" aria-label="Inhaltsverzeichnis">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Inhaltsverzeichnis
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#kontext" class="md-nav__link">
<span class="md-ellipsis">
Kontext
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#optionen" class="md-nav__link">
<span class="md-ellipsis">
Optionen
</span>
</a>
<nav class="md-nav" aria-label="Optionen">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#option-a-alles-im-image-manuelle-backups" class="md-nav__link">
<span class="md-ellipsis">
Option A — Alles im Image, manuelle Backups
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#option-b-docker-volumes-fur-db-und-reports" class="md-nav__link">
<span class="md-ellipsis">
Option B — Docker-Volumes für DB und Reports
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#option-c-externe-db-postgres" class="md-nav__link">
<span class="md-ellipsis">
Option C — Externe DB (Postgres)
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#entscheidung" class="md-nav__link">
<span class="md-ellipsis">
Entscheidung
</span>
</a>
<nav class="md-nav" aria-label="Entscheidung">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#standard-deploy" class="md-nav__link">
<span class="md-ellipsis">
Standard-Deploy
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#manueller-tar-upload-falls-git-workflow-blockiert-ist" class="md-nav__link">
<span class="md-ellipsis">
Manueller Tar-Upload (falls Git-Workflow blockiert ist)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#sn-xml-sonderpfad" class="md-nav__link">
<span class="md-ellipsis">
SN-XML-Sonderpfad
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#container-zeitzone" class="md-nav__link">
<span class="md-ellipsis">
Container-Zeitzone
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#konsequenzen" class="md-nav__link">
<span class="md-ellipsis">
Konsequenzen
</span>
</a>
<nav class="md-nav" aria-label="Konsequenzen">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#positiv" class="md-nav__link">
<span class="md-ellipsis">
Positiv
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#negativ" class="md-nav__link">
<span class="md-ellipsis">
Negativ
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#folgen-fur-andere-adrs" class="md-nav__link">
<span class="md-ellipsis">
Folgen für andere ADRs
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--section md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_3" >
<label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="">
<span class="md-ellipsis">
Archiv
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Archiv
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../archive/" class="md-nav__link">
<span class="md-ellipsis">
Übersicht
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Inhaltsverzeichnis">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Inhaltsverzeichnis
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#kontext" class="md-nav__link">
<span class="md-ellipsis">
Kontext
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#optionen" class="md-nav__link">
<span class="md-ellipsis">
Optionen
</span>
</a>
<nav class="md-nav" aria-label="Optionen">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#option-a-alles-im-image-manuelle-backups" class="md-nav__link">
<span class="md-ellipsis">
Option A — Alles im Image, manuelle Backups
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#option-b-docker-volumes-fur-db-und-reports" class="md-nav__link">
<span class="md-ellipsis">
Option B — Docker-Volumes für DB und Reports
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#option-c-externe-db-postgres" class="md-nav__link">
<span class="md-ellipsis">
Option C — Externe DB (Postgres)
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#entscheidung" class="md-nav__link">
<span class="md-ellipsis">
Entscheidung
</span>
</a>
<nav class="md-nav" aria-label="Entscheidung">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#standard-deploy" class="md-nav__link">
<span class="md-ellipsis">
Standard-Deploy
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#manueller-tar-upload-falls-git-workflow-blockiert-ist" class="md-nav__link">
<span class="md-ellipsis">
Manueller Tar-Upload (falls Git-Workflow blockiert ist)
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#sn-xml-sonderpfad" class="md-nav__link">
<span class="md-ellipsis">
SN-XML-Sonderpfad
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#container-zeitzone" class="md-nav__link">
<span class="md-ellipsis">
Container-Zeitzone
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#konsequenzen" class="md-nav__link">
<span class="md-ellipsis">
Konsequenzen
</span>
</a>
<nav class="md-nav" aria-label="Konsequenzen">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#positiv" class="md-nav__link">
<span class="md-ellipsis">
Positiv
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#negativ" class="md-nav__link">
<span class="md-ellipsis">
Negativ
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#folgen-fur-andere-adrs" class="md-nav__link">
<span class="md-ellipsis">
Folgen für andere ADRs
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1 id="0004-docker-compose-deploy-mit-db-reports-volume-und-sn-xml-sonderpfad">0004 — Docker Compose Deploy mit DB-/Reports-Volume und SN-XML-Sonderpfad<a class="headerlink" href="#0004-docker-compose-deploy-mit-db-reports-volume-und-sn-xml-sonderpfad" title="Permanent link">&para;</a></h1>
<table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Status</strong></td>
<td>accepted</td>
</tr>
<tr>
<td><strong>Datum</strong></td>
<td>2026-04-10</td>
</tr>
<tr>
<td><strong>Refs</strong></td>
<td>CLAUDE.md "Deployment", <code>docker-compose.yml</code>, Issue #5, project_sn_xml_export</td>
</tr>
</tbody>
</table>
<h2 id="kontext">Kontext<a class="headerlink" href="#kontext" title="Permanent link">&para;</a></h2>
<p>Der GWÖ-Antragsprüfer läuft als Docker-Container <code>gwoe-antragspruefer</code> auf
einem VServer hinter Traefik (Let's Encrypt SSL, Domain
<code>gwoe.toppyr.de</code>). Code wird via Git aus <code>repo.toppyr.de</code> gezogen.</p>
<p>Drei Subsysteme haben unterschiedliche Lebenszyklen:</p>
<ol>
<li><strong>Code</strong> (<code>app/</code>) — wird bei jedem Deploy neu kopiert.</li>
<li><strong>SQLite-Daten</strong> (<code>data/gwoe-antraege.db</code>, <code>data/embeddings.db</code>) —
Source of Truth, MUSS persistent über Deploys hinweg.</li>
<li><strong>PDF-Reports</strong> (<code>reports/*.pdf</code>) — sind generierte Artefakte, könnten
theoretisch regeneriert werden, sind aber teuer (LLM-Calls + WeasyPrint),
also auch persistent.</li>
</ol>
<p>Issue #5 hatte einen frühen Schmerzpunkt: der Container-Build hat die
DB überschrieben, weil <code>data/</code> nicht aus dem Build-Context exkludiert war.</p>
<h2 id="optionen">Optionen<a class="headerlink" href="#optionen" title="Permanent link">&para;</a></h2>
<h3 id="option-a-alles-im-image-manuelle-backups">Option A — Alles im Image, manuelle Backups<a class="headerlink" href="#option-a-alles-im-image-manuelle-backups" title="Permanent link">&para;</a></h3>
<p>Code, DB, Reports zusammen im Image. Backups via <code>docker cp</code> vor jedem
Deploy.</p>
<p><strong>Nachteile:</strong> Image wird gigantisch, jeder Deploy ist ein Risk-Event,
kein automatischer Persistenz-Mechanismus.</p>
<h3 id="option-b-docker-volumes-fur-db-und-reports">Option B — Docker-Volumes für DB und Reports<a class="headerlink" href="#option-b-docker-volumes-fur-db-und-reports" title="Permanent link">&para;</a></h3>
<p><code>docker-compose.yml</code> mountet <code>./data</code> und <code>./reports</code> vom Host als Volumes.
Build kopiert nur <code>app/</code> und <code>requirements.txt</code>.</p>
<p><strong>Vorteile:</strong> Host-Volumes überleben Container-Restart und Image-Rebuild.
Backups via Standard-Linux-Tools auf dem Host.</p>
<p><strong>Nachteile:</strong> Build-Context muss <code>data/</code>, <code>reports/</code>, <code>.env</code> exkludieren
(siehe <code>.dockerignore</code>), sonst werden sie versehentlich ins Image kopiert
und überschreiben das gemountete Volume bei Container-Start.</p>
<h3 id="option-c-externe-db-postgres">Option C — Externe DB (Postgres)<a class="headerlink" href="#option-c-externe-db-postgres" title="Permanent link">&para;</a></h3>
<p>Postgres als separater Container, gwoe-antragspruefer verbindet per asyncpg.</p>
<p><strong>Vorteile:</strong> standard, robust, Backups via pg_dump.</p>
<p><strong>Nachteile:</strong> Migration aller existierenden Queries, neue Abhängigkeit,
mehr Operational Surface. SQLite reicht für die aktuelle Last (~30 Anträge,
selten parallele Writes).</p>
<h2 id="entscheidung">Entscheidung<a class="headerlink" href="#entscheidung" title="Permanent link">&para;</a></h2>
<p><strong>Option B</strong>. Docker-Compose mit Host-Volumes für <code>data/</code> und <code>reports/</code>.
<code>.dockerignore</code> exkludiert beide aus dem Build-Context.</p>
<h3 id="standard-deploy">Standard-Deploy<a class="headerlink" href="#standard-deploy" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code>ssh<span class="w"> </span>vserver<span class="w"> </span><span class="s1">&#39;cd /opt/gwoe-antragspruefer &amp;&amp; git pull &amp;&amp; docker compose up -d --build&#39;</span>
</code></pre></div>
<h3 id="manueller-tar-upload-falls-git-workflow-blockiert-ist">Manueller Tar-Upload (falls Git-Workflow blockiert ist)<a class="headerlink" href="#manueller-tar-upload-falls-git-workflow-blockiert-ist" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code><span class="nb">cd</span><span class="w"> </span>webapp
tar<span class="w"> </span>czf<span class="w"> </span>/tmp/gwoe-webapp.tar.gz<span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--exclude<span class="o">=</span><span class="s1">&#39;venv&#39;</span><span class="w"> </span>--exclude<span class="o">=</span><span class="s1">&#39;__pycache__&#39;</span><span class="w"> </span><span class="se">\</span>
<span class="w"> </span>--exclude<span class="o">=</span><span class="s1">&#39;data&#39;</span><span class="w"> </span>--exclude<span class="o">=</span><span class="s1">&#39;reports&#39;</span><span class="w"> </span>--exclude<span class="o">=</span><span class="s1">&#39;.env&#39;</span><span class="w"> </span>.
scp<span class="w"> </span>/tmp/gwoe-webapp.tar.gz<span class="w"> </span>vserver:/tmp/
ssh<span class="w"> </span>vserver<span class="w"> </span><span class="s1">&#39;cd /opt/gwoe-antragspruefer &amp;&amp; tar xzf /tmp/gwoe-webapp.tar.gz &amp;&amp; docker compose up -d --build&#39;</span>
</code></pre></div>
<p>Beachte: <code>--exclude='data'</code> ist <strong>zwingend</strong>, sonst überschreibt der Tar
die Live-DB.</p>
<h3 id="sn-xml-sonderpfad">SN-XML-Sonderpfad<a class="headerlink" href="#sn-xml-sonderpfad" title="Permanent link">&para;</a></h3>
<p>Sachsen hat keinen scrape-baren Endpoint und liest stattdessen wöchentlich
manuell exportierte XML-Dumps aus EDAS. Workflow:</p>
<ol>
<li>User exportiert XML aus EDAS (manuell, im Browser).</li>
<li><code>cp dokumente_export.xml gwoe-antragspruefer:/app/data/sn-edas/</code></li>
<li><code>scp</code> aus dem Container ins Host-Volume — kein Container-Restart nötig.</li>
<li>SNEdasXmlAdapter liest die XML beim nächsten Search-Call.</li>
</ol>
<p>Details in <code>~/.claude/projects/&lt;projekt&gt;/memory/project_sn_xml_export.md</code>.</p>
<h3 id="container-zeitzone">Container-Zeitzone<a class="headerlink" href="#container-zeitzone" title="Permanent link">&para;</a></h3>
<p>Der Container läuft <strong>UTC</strong>, nicht CEST. DB-Timestamps in <code>assessments.created_at</code>
sind UTC (kein TZ-Suffix, aber UTC). Beim Korrelieren mit Commit-Zeiten
(lokal CEST = UTC+2) muss konvertiert werden, sonst fließen falsche
Schlussfolgerungen ein. Detailliert in
<code>~/.claude/projects/&lt;projekt&gt;/memory/reference_container_utc.md</code>.</p>
<h2 id="konsequenzen">Konsequenzen<a class="headerlink" href="#konsequenzen" title="Permanent link">&para;</a></h2>
<h3 id="positiv">Positiv<a class="headerlink" href="#positiv" title="Permanent link">&para;</a></h3>
<ul>
<li><strong>DB überlebt jeden Deploy</strong> — verifiziert seit Issue #5 (Fix in
<code>.dockerignore</code>-Update).</li>
<li><strong>Backups sind trivial</strong>: <code>tar czf gwoe-data-$(date +%F).tar.gz data/</code>
auf dem Host.</li>
<li><strong>Build ist schnell</strong> (~30s für nicht-cached Layers), weil das Image
nur Code + Dependencies enthält.</li>
</ul>
<h3 id="negativ">Negativ<a class="headerlink" href="#negativ" title="Permanent link">&para;</a></h3>
<ul>
<li><strong><code>.dockerignore</code> ist ein Foot-Gun</strong> — wenn jemand vergisst, <code>data/</code> neu
hinzuzufügen nach einem Refactor, kann es passieren dass der Build die
Live-DB überschreibt. Mitigation: ein dedicated Sub-D-style Test, der
nach dem Build prüft, dass die DB die erwarteten Tabellen hat — steht
noch aus.</li>
<li><strong>SN-XML braucht manuelle Pflege</strong> wöchentlich. Akzeptiert weil es kein
scrape-baren Endpoint gibt.</li>
<li><strong>SQLite skaliert nicht über parallele Writes</strong> — bei mehr als ~5
gleichzeitigen Analyses würde es Lock-Contention geben. Aktuell läuft
alles seriell durch den Background-Task-Mechanismus, also kein Problem.
Bei Wachstum auf &gt;50 Analyses/Tag wäre ein Postgres-Migration ein
separater ADR.</li>
</ul>
<h3 id="folgen-fur-andere-adrs">Folgen für andere ADRs<a class="headerlink" href="#folgen-fur-andere-adrs" title="Permanent link">&para;</a></h3>
<ul>
<li>ADR 0002 (Adapter-Architektur) ist davon unabhängig — Adapter sind reine
Code-Klassen ohne State.</li>
<li>Ein zukünftiger Postgres-Migration-ADR würde diesen ADR partial superseden
(DB-Persistenz, nicht Reports).</li>
</ul>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"annotate": null, "base": "../..", "features": ["navigation.sections", "navigation.expand", "search.highlight"], "search": "../../assets/javascripts/workers/search.2c215733.min.js", "tags": null, "translations": {"clipboard.copied": "In Zwischenablage kopiert", "clipboard.copy": "In Zwischenablage kopieren", "search.result.more.one": "1 weiteres Suchergebnis auf dieser Seite", "search.result.more.other": "# weitere Suchergebnisse auf dieser Seite", "search.result.none": "Keine Suchergebnisse", "search.result.one": "1 Suchergebnis", "search.result.other": "# Suchergebnisse", "search.result.placeholder": "Suchbegriff eingeben", "search.result.term.missing": "Es fehlt", "select.version": "Version ausw\u00e4hlen"}, "version": null}</script>
<script src="../../assets/javascripts/bundle.79ae519e.min.js"></script>
</body>
</html>