fix: Gitea Traefik routing and connection pool optimization
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 10m14s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Check for Dependency Changes (push) Failing after 11m25s
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled

- Remove middleware reference from Gitea Traefik labels (caused routing issues)
- Optimize Gitea connection pool settings (MAX_IDLE_CONNS=30, authentication_timeout=180s)
- Add explicit service reference in Traefik labels
- Fix intermittent 504 timeouts by improving PostgreSQL connection handling

Fixes Gitea unreachability via git.michaelschiemer.de
This commit is contained in:
2025-11-09 14:46:15 +01:00
parent 85c369e846
commit 36ef2a1e2c
1366 changed files with 104925 additions and 28719 deletions

View File

@@ -2,16 +2,40 @@
## Übersicht
Dieses Dokument erklärt, wie genau das Deployment in den Application Stack abläuft, wenn die CI/CD Pipeline ausgeführt wird.
Dieses Dokument erklärt, wie genau das Deployment in den Application Stack abläuft. Es gibt zwei Deployment-Szenarien:
1. **Initial Deployment** - Erstes Setup des Servers (Rsync-basiert)
2. **Normal Deployment** - Regelmäßige Deployments via CI/CD (Git-basiert)
**📖 Verwandte Dokumentation:**
- **[Initial Deployment Guide](../guides/initial-deployment-guide.md)** - Schritt-für-Schritt Initial Deployment
- **[Code Deployment Workflow](../guides/code-deployment-workflow.md)** - Unterschiede zwischen Rsync und Git
- **[Code Changes Workflow](../guides/code-change-workflow.md)** - Wie Codeänderungen gepusht werden
- **[CI/CD Status](../status/ci-cd-status.md)** - Aktueller Status der Pipeline
- **[Troubleshooting Guide](../troubleshooting/initial-deployment-issues.md)** - Häufige Probleme und Lösungen
---
## Deployment-Flow
### Initial Deployment (Rsync-basiert)
```
Local Repository
1. Code Sync via rsync (sync-application-code.yml)
2. Composer Dependencies installieren (install-composer-dependencies.yml)
3. Docker Image Build & Push (build-initial-image.yml)
4. Application Stack deployen (setup-infrastructure.yml)
5. Container starten und verifizieren
```
### Normal Deployment (Git-basiert / CI/CD)
```
CI/CD Pipeline (Gitea Actions)
@@ -19,9 +43,11 @@ CI/CD Pipeline (Gitea Actions)
2. Docker Image Build & Push zur Registry
3. Ansible Playbook ausführen
3. Code deployen via Git (deploy-application-code.yml)
4. Application Stack aktualisieren
4. Ansible Playbook ausführen (deploy-update.yml)
5. Application Stack aktualisieren
```
### Secret Handling für Redis
@@ -30,7 +56,7 @@ CI/CD Pipeline (Gitea Actions)
unter dem Schlüssel `vault_redis_password`.
- Die Application-Rolle (`roles/application/tasks/sync.yml`) bricht den Deploy ab,
wenn kein Passwort aus dem Vault oder via `-e redis_password=...` vorhanden ist.
- Während des Deployments wird das Passwort in `stacks/application/.env` geschrieben
- Während des Deployments wird das Passwort in `stacks/production/.env` geschrieben
und steht damit allen PHP-Containern über `REDIS_PASSWORD` zur Verfügung.
- Docker Secrets mit `REDIS_PASSWORD_FILE` werden weiterhin unterstützt, da der
Entry-Point das Secret lädt bevor PHP-FPM startet.
@@ -117,7 +143,7 @@ Das Ansible Playbook führt folgende Schritte auf dem Production-Server aus:
**3. Verzeichnisse erstellen**
```yaml
- Application Stack Path: ~/deployment/stacks/application
- Application Stack Path: ~/deployment/stacks/production
- Backup Verzeichnis: ~/deployment/backups/<timestamp>/
```
@@ -387,7 +413,7 @@ docker pull registry.michaelschiemer.de/framework:abc1234-1696234567
# Nachher: image: registry.michaelschiemer.de/framework:abc1234-1696234567
# 5. Stack neu starten
cd ~/deployment/stacks/application
cd ~/deployment/stacks/production
docker compose up -d --pull always --force-recreate --remove-orphans
# 6. Health-Checks warten
@@ -526,7 +552,7 @@ ansible-playbook -i inventory/production.yml \
```bash
# Logs prüfen
docker compose -f ~/deployment/stacks/application/docker-compose.yml logs
docker compose -f ~/deployment/stacks/production/docker-compose.yml logs
# Health-Check-Status prüfen
docker compose ps