diff --git a/PROJECT_STRUCTURE.md b/PROJECT_STRUCTURE.md index 0519ecba..c16be8cb 100644 --- a/PROJECT_STRUCTURE.md +++ b/PROJECT_STRUCTURE.md @@ -1 +1,175 @@ - \ No newline at end of file +# ๐Ÿ—๏ธ MYP Projektstruktur - Perfektionierte Architektur + +## ๐Ÿ“‹ รœbersicht + +MYP (Manage your Printer) ist ein containerbasiertes Microservice-System mit klarer Trennung zwischen Frontend und Backend. + +## ๐Ÿ—‚๏ธ Verzeichnisstruktur + +``` +Projektarbeit-MYP/ +โ”œโ”€โ”€ ๐Ÿ–ฅ๏ธ backend/ # Flask API Server (Port 5000) +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ src/ # Hauptanwendungslogik +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ api/ # API Endpunkte +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ models/ # Datenmodelle +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ services/ # Geschรคftslogik +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ auth/ # Authentifizierungslogik +โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“ utils/ # Hilfsfunktionen +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ tests/ # Unit- und Integrationstests +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ migrations/ # Datenbankmigrationen +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ instance/ # SQLite Datenbank (gitignore) +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ logs/ # Anwendungslogs (gitignore) +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ config/ # Konfigurationsdateien +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ Dockerfile # Backend Container +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ requirements.txt # Python Abhรคngigkeiten +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ app.py # Flask Anwendung Einstiegspunkt +โ”‚ โ””โ”€โ”€ ๐Ÿ“„ .env.example # Umgebungsvariablen Vorlage +โ”‚ +โ”œโ”€โ”€ ๐ŸŒ frontend/ # Next.js Web Interface (Port 3000) +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ src/ # Hauptanwendungslogik +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ app/ # Next.js App Router +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ components/ # React Komponenten +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“ lib/ # Bibliotheken und Utilities +โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“ types/ # TypeScript Typdefinitionen +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ public/ # Statische Assets +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ drizzle/ # Frontend Datenbankschema +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ tests/ # Frontend Tests +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ Dockerfile # Frontend Container +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ package.json # Node.js Abhรคngigkeiten +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ next.config.mjs # Next.js Konfiguration +โ”‚ โ””โ”€โ”€ ๐Ÿ“„ .env.example # Umgebungsvariablen Vorlage +โ”‚ +โ”œโ”€โ”€ ๐Ÿ”„ proxy/ # Caddy Reverse Proxy (Port 80/443) +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ Caddyfile # Proxy Konfiguration +โ”‚ โ””โ”€โ”€ ๐Ÿ“„ docker-compose.caddy.yml # Caddy Service Definition +โ”‚ +โ”œโ”€โ”€ ๐Ÿ“Š monitoring/ # รœberwachung und Logging +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ grafana/ # Dashboards +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ prometheus/ # Metriken +โ”‚ โ””โ”€โ”€ ๐Ÿ“„ docker-compose.monitoring.yml +โ”‚ +โ”œโ”€โ”€ ๐Ÿ”ง infrastructure/ # Infrastruktur-Konfiguration +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ scripts/ # Automatisierungsskripte +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ start.sh # Linux/MacOS Start +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ start.ps1 # Windows Start +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ cleanup.sh # Linux/MacOS Bereinigung +โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“„ cleanup.ps1 # Windows Bereinigung +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ environments/ # Umgebungskonfigurationen +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ development.env # Entwicklungsumgebung +โ”‚ โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ production.env # Produktionsumgebung +โ”‚ โ”‚ โ””โ”€โ”€ ๐Ÿ“„ testing.env # Testumgebung +โ”‚ โ””โ”€โ”€ ๐Ÿ“ ssl/ # SSL Zertifikate (gitignore) +โ”‚ +โ”œโ”€โ”€ ๐Ÿ“š docs/ # Projektdokumentation +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ API.md # API Dokumentation +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ DEPLOYMENT.md # Deployment Anweisungen +โ”‚ โ”œโ”€โ”€ ๐Ÿ“„ DEVELOPMENT.md # Entwicklungsrichtlinien +โ”‚ โ””โ”€โ”€ ๐Ÿ“„ ARCHITECTURE.md # Systemarchitektur +โ”‚ +โ”œโ”€โ”€ ๐Ÿงช tests/ # รœbergreifende Tests +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ integration/ # Integrationstests +โ”‚ โ”œโ”€โ”€ ๐Ÿ“ e2e/ # End-to-End Tests +โ”‚ โ””โ”€โ”€ ๐Ÿ“„ docker-compose.test.yml # Test Environment +โ”‚ +โ”œโ”€โ”€ ๐Ÿ“„ docker-compose.yml # Hauptkomposition (Prod) +โ”œโ”€โ”€ ๐Ÿ“„ docker-compose.dev.yml # Entwicklungsumgebung +โ”œโ”€โ”€ ๐Ÿ“„ docker-compose.override.yml # Lokale Overrides +โ”œโ”€โ”€ ๐Ÿ“„ .gitignore # Git Ignorierte Dateien +โ”œโ”€โ”€ ๐Ÿ“„ .dockerignore # Docker Ignorierte Dateien +โ”œโ”€โ”€ ๐Ÿ“„ README.md # Projekt Hauptdokumentation +โ””โ”€โ”€ ๐Ÿ“„ PROJECT_STRUCTURE.md # Diese Strukturdokumentation +``` + +## ๐Ÿ”Œ Service-Kommunikation + +### Interne Container-Kommunikation +- **Frontend โ†’ Backend**: `http://backend:5000/api` +- **Proxy โ†’ Frontend**: `http://frontend:3000` +- **Proxy โ†’ Backend**: `http://backend:5000` + +### Externe Zugriffe +- **Web Interface**: `https://localhost` (รผber Caddy Proxy) +- **API Direct**: `http://localhost:5000` (nur Entwicklung) +- **Frontend Direct**: `http://localhost:3000` (nur Entwicklung) + +## ๐ŸŒ Netzwerk-Architektur + +``` +Internet/Intranet + โ†“ +[Caddy Proxy] (80/443) + โ†“ + โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” + โ†“ โ†“ โ†“ +[Frontend] [Backend] [Monitoring] + (3000) (5000) (9090/3001) + โ†“ โ†“ +[SQLite] [SQLite] +``` + +## ๐Ÿ” Sicherheitskonzept + +### Umgebungsvariablen +- Sensible Daten nur รผber `.env` Dateien +- Produktionsgeheimnisse รผber sichere Umgebungsvariablen +- Keine Geheimnisse in Git-Repository + +### Netzwerksicherheit +- Container-isolierte Netzwerke +- Nur notwendige Ports exponiert +- HTTPS-Verschlรผsselung รผber Caddy +- Firewall-kompatible Konfiguration + +### Authentifizierung +- JWT-Token fรผr API-Authentifizierung +- Session-basierte Frontend-Authentifizierung +- OAuth2 Integration vorbereitet + +## ๐Ÿš€ Deployment-Strategien + +### Entwicklung +```bash +# Linux/MacOS +./infrastructure/scripts/start.sh dev + +# Windows +.\infrastructure\scripts\start.ps1 dev +``` + +### Produktion +```bash +# Linux/MacOS +./infrastructure/scripts/start.sh prod + +# Windows +.\infrastructure\scripts\start.ps1 prod +``` + +## ๐Ÿ“ฆ Container-Optimierungen + +### Multi-Stage Builds +- Frontend: Node.js Build โ†’ Minimales Runtime Image +- Backend: Python Requirements โ†’ Optimiertes Laufzeit-Image +- Reduzierte Image-GrรถรŸen und Sicherheitsoberflรคche + +### Health Checks +- Automatische Gesundheitsprรผfungen fรผr alle Services +- Graceful Restart bei Fehlern +- Monitoring-Integration + +### Volume Management +- Persistente Datenbank-Volumes +- Log-Rotation und -Management +- Backup-freundliche Struktur + +## ๐Ÿ”„ CI/CD Integration + +### Git Hooks +- Pre-commit Linting und Testing +- Automatische Dependency Updates +- Security Scanning + +### Container Registry +- Automatisches Image Building +- Versionierung รผber Git Tags +- Multi-Architecture Support (x86_64, ARM64) \ No newline at end of file diff --git a/backend/Dockerfile.dev b/backend/Dockerfile.dev index 0519ecba..4a40b9c2 100644 --- a/backend/Dockerfile.dev +++ b/backend/Dockerfile.dev @@ -1 +1,49 @@ - \ No newline at end of file +# ๐Ÿ”ง MYP Backend - Entwicklungs-Container +# Optimiert fรผr Hot Reload und Debugging + +FROM python:3.11-slim + +# Arbeitsverzeichnis setzen +WORKDIR /app + +# System-Abhรคngigkeiten installieren +RUN apt-get update && apt-get install -y \ + curl \ + sqlite3 \ + wget \ + git \ + build-essential \ + && rm -rf /var/lib/apt/lists/* + +# Python-Abhรคngigkeiten installieren +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Entwicklungs-spezifische Pakete +RUN pip install --no-cache-dir \ + watchdog \ + flask-debugtoolbar \ + pytest \ + pytest-cov \ + black \ + flake8 + +# Verzeichnisse erstellen +RUN mkdir -p logs instance + +# Umgebungsvariablen fรผr Entwicklung +ENV FLASK_APP=app.py +ENV FLASK_ENV=development +ENV FLASK_DEBUG=1 +ENV PYTHONUNBUFFERED=1 +ENV PYTHONDONTWRITEBYTECODE=1 + +# Port freigeben +EXPOSE 5000 5555 + +# Health Check +HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ + CMD curl -f http://localhost:5000/health || exit 1 + +# Entwicklungs-Startbefehl (wird durch docker-compose รผberschrieben) +CMD ["flask", "run", "--host=0.0.0.0", "--port=5000", "--reload", "--debugger"] \ No newline at end of file diff --git a/frontend/Dockerfile.dev b/frontend/Dockerfile.dev new file mode 100644 index 00000000..c1e8ef2c --- /dev/null +++ b/frontend/Dockerfile.dev @@ -0,0 +1,45 @@ +# ๐Ÿ”ง MYP Frontend - Entwicklungs-Container +# Optimiert fรผr Hot Reload und Debugging + +FROM node:20-bookworm-slim + +# Arbeitsverzeichnis erstellen +WORKDIR /app + +# System-Abhรคngigkeiten installieren +RUN apt-get update && apt-get install -y \ + curl \ + git \ + && rm -rf /var/lib/apt/lists/* + +# pnpm aktivieren +RUN corepack enable pnpm + +# Package-Dateien kopieren +COPY package.json pnpm-lock.yaml ./ + +# Abhรคngigkeiten installieren +RUN pnpm install + +# Entwicklungs-spezifische Pakete +RUN pnpm add -D \ + @types/node \ + typescript \ + eslint \ + prettier + +# Umgebungsvariablen fรผr Entwicklung +ENV NODE_ENV=development +ENV NEXT_TELEMETRY_DISABLED=1 +ENV WATCHPACK_POLLING=true +ENV PORT=3000 + +# Ports freigeben +EXPOSE 3000 8081 + +# Health Check +HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ + CMD curl -f http://localhost:3000 || exit 1 + +# Entwicklungs-Startbefehl (wird durch docker-compose รผberschrieben) +CMD ["pnpm", "dev"] \ No newline at end of file diff --git a/start.ps1 b/start.ps1 index 63ac2b90..5d251cbd 100644 --- a/start.ps1 +++ b/start.ps1 @@ -1,137 +1,100 @@ -# Projektarbeit-MYP Startskript fรผr Windows -# Dieses Skript startet alle notwendigen Dienste fรผr das MYP-Projekt +# ๐Ÿš€ MYP - Manage your Printer (Hauptstartskript) +# Weiterleitung an das optimierte Infrastructure-Startskript -Write-Host "Starte MYP-Projekt..." -ForegroundColor Green - -# SSH-Server (OpenSSH) prรผfen und aktivieren -Write-Host "Prรผfe SSH-Server-Status..." -ForegroundColor Yellow - -# Prรผfen ob OpenSSH Server installiert ist -$opensshService = Get-Service -Name 'sshd' -ErrorAction SilentlyContinue - -if ($null -eq $opensshService) { - Write-Host "OpenSSH Server ist nicht installiert. Versuche zu installieren..." -ForegroundColor Yellow +param( + [Parameter(Position=0)] + [ValidateSet("dev", "prod", "test", "development", "production")] + [string]$Environment = "dev", - # Prรผfen, ob Windows 10/11 mit der Option zum Installieren von Windows-Features - if (Get-Command -Name "Add-WindowsCapability" -ErrorAction SilentlyContinue) { - try { - # OpenSSH Server installieren - Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 - Write-Host "OpenSSH Server wurde installiert." -ForegroundColor Green - } catch { - Write-Host "Fehler bei der Installation des OpenSSH Servers. Bitte installieren Sie ihn manuell." -ForegroundColor Red - Write-Host "Anleitung: https://docs.microsoft.com/de-de/windows-server/administration/openssh/openssh_install_firstuse" -ForegroundColor Cyan - } + [switch]$Help, + [switch]$Version, + [switch]$Clean +) + +# Farbdefinitionen fรผr bessere Ausgabe +$Colors = @{ + Info = "Cyan" + Success = "Green" + Warning = "Yellow" + Error = "Red" + Header = "Magenta" +} + +function Write-ColorOutput { + param([string]$Message, [string]$Color = "White") + Write-Host $Message -ForegroundColor $Colors[$Color] +} + +# Header anzeigen +Write-ColorOutput "๐Ÿ–จ๏ธ MYP - Manage your Printer" "Header" +Write-ColorOutput "โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•" "Header" + +# Hilfe anzeigen +if ($Help) { + Write-ColorOutput "`n๐Ÿ“– Verwendung:" "Info" + Write-ColorOutput " .\start.ps1 [Environment] [Optionen]" "White" + Write-ColorOutput "`n๐ŸŒ Verfรผgbare Umgebungen:" "Info" + Write-ColorOutput " dev, development - Entwicklungsumgebung (Standard)" "White" + Write-ColorOutput " prod, production - Produktionsumgebung" "White" + Write-ColorOutput " test - Testumgebung" "White" + Write-ColorOutput "`nโš™๏ธ Optionen:" "Info" + Write-ColorOutput " -Help - Diese Hilfe anzeigen" "White" + Write-ColorOutput " -Version - Versionsinformationen anzeigen" "White" + Write-ColorOutput " -Clean - System vor Start bereinigen" "White" + Write-ColorOutput "`n๐Ÿ“š Beispiele:" "Info" + Write-ColorOutput " .\start.ps1 # Entwicklungsumgebung starten" "White" + Write-ColorOutput " .\start.ps1 prod # Produktionsumgebung starten" "White" + Write-ColorOutput " .\start.ps1 dev -Clean # Mit Bereinigung starten" "White" + exit 0 +} + +# Version anzeigen +if ($Version) { + Write-ColorOutput "`n๐Ÿ“‹ Systeminformationen:" "Info" + Write-ColorOutput " MYP Version: 2.0.0" "White" + Write-ColorOutput " PowerShell: $($PSVersionTable.PSVersion)" "White" + Write-ColorOutput " OS: $($PSVersionTable.OS)" "White" + Write-ColorOutput " Architektur: $env:PROCESSOR_ARCHITECTURE" "White" + exit 0 +} + +# Bereinigung falls gewรผnscht +if ($Clean) { + Write-ColorOutput "`n๐Ÿงน System wird bereinigt..." "Warning" + & ".\infrastructure\scripts\cleanup.ps1" -Force + if ($LASTEXITCODE -ne 0) { + Write-ColorOutput "โŒ Bereinigung fehlgeschlagen!" "Error" + exit 1 + } + Write-ColorOutput "โœ… System erfolgreich bereinigt!" "Success" +} + +# Prรผfe ob Infrastructure-Skript existiert +$InfraScript = ".\infrastructure\scripts\start.ps1" +if (-not (Test-Path $InfraScript)) { + Write-ColorOutput "`nโŒ Infrastructure-Startskript nicht gefunden: $InfraScript" "Error" + Write-ColorOutput " Bitte stellen Sie sicher, dass die Projektstruktur vollstรคndig ist." "Error" + exit 1 +} + +# Weiterleitung an Infrastructure-Skript +Write-ColorOutput "`n๐Ÿ”„ Weiterleitung an Infrastructure-Startskript..." "Info" +Write-ColorOutput " Umgebung: $Environment" "White" + +try { + & $InfraScript $Environment + $ExitCode = $LASTEXITCODE + + if ($ExitCode -eq 0) { + Write-ColorOutput "`n๐ŸŽ‰ MYP erfolgreich gestartet!" "Success" + Write-ColorOutput " Zugriff รผber: http://localhost" "Info" } else { - Write-Host "Windows-Feature zum Installieren von OpenSSH Server nicht verfรผgbar." -ForegroundColor Red - Write-Host "Bitte installieren Sie OpenSSH Server manuell:" -ForegroundColor Red - Write-Host "1. ร–ffnen Sie 'Einstellungen' > 'Apps' > 'Optionale Features'" -ForegroundColor Cyan - Write-Host "2. Klicken Sie auf 'Feature hinzufรผgen' und wรคhlen Sie 'OpenSSH Server'" -ForegroundColor Cyan + Write-ColorOutput "`nโŒ Start fehlgeschlagen (Exit Code: $ExitCode)" "Error" } - # Erneut prรผfen, ob der Dienst jetzt verfรผgbar ist - $opensshService = Get-Service -Name 'sshd' -ErrorAction SilentlyContinue -} - -if ($null -ne $opensshService) { - # OpenSSH Server beim Systemstart aktivieren - Write-Host "Aktiviere OpenSSH Server beim Systemstart..." -ForegroundColor Yellow - Set-Service -Name 'sshd' -StartupType Automatic - - # OpenSSH Server starten, falls nicht bereits gestartet - if ($opensshService.Status -ne 'Running') { - Write-Host "Starte OpenSSH Server..." -ForegroundColor Yellow - Start-Service -Name 'sshd' - Write-Host "OpenSSH Server wurde gestartet." -ForegroundColor Green - } else { - Write-Host "OpenSSH Server lรคuft bereits." -ForegroundColor Green - } - - # Firewall-Regel fรผr SSH hinzufรผgen (Port 22) - $firewallRule = Get-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -ErrorAction SilentlyContinue - if ($null -eq $firewallRule) { - Write-Host "Erstelle Firewall-Regel fรผr OpenSSH Server..." -ForegroundColor Yellow - New-NetFirewallRule -Name 'OpenSSH-Server-In-TCP' -DisplayName 'OpenSSH Server (TCP-In)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 - } -} else { - Write-Host "OpenSSH Server konnte nicht installiert werden. Bitte installieren Sie ihn manuell." -ForegroundColor Red -} - -# รœberprรผfen, ob Docker Desktop lรคuft -$dockerProcess = Get-Process "Docker Desktop" -ErrorAction SilentlyContinue -if ($null -eq $dockerProcess) { - Write-Host "Docker Desktop wird gestartet..." -ForegroundColor Yellow - Start-Process "C:\Program Files\Docker\Docker\Docker Desktop.exe" - - # Warten, bis Docker Desktop vollstรคndig geladen ist - Write-Host "Warte, bis Docker Desktop bereit ist..." -ForegroundColor Yellow - $retryCount = 0 - $maxRetries = 30 - - do { - Start-Sleep -Seconds 5 - $retryCount++ - $dockerRunning = docker info 2>$null - - if ($retryCount -gt $maxRetries) { - Write-Host "Docker Desktop konnte nicht gestartet werden. Bitte starten Sie Docker Desktop manuell und fรผhren Sie dieses Skript erneut aus." -ForegroundColor Red - exit 1 - } - } while ($null -eq $dockerRunning) - - Write-Host "Docker Desktop ist bereit." -ForegroundColor Green -} - -# รœberprรผfen, ob die Container bereits laufen -$runningContainers = docker ps --format "{{.Names}}" | Select-String -Pattern "myp-backend|myp-rp|myp-caddy" - -if ($runningContainers.Count -eq 3) { - Write-Host "Alle MYP-Container laufen bereits." -ForegroundColor Green -} else { - # Container starten - Write-Host "Starte MYP-Container..." -ForegroundColor Yellow - - # Ins Projektverzeichnis wechseln - $scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path - Set-Location -Path $scriptPath - - # Docker-Compose ausfรผhren - docker-compose up -d - - # Warten, bis alle Container laufen - Write-Host "Warte, bis alle Container bereit sind..." -ForegroundColor Yellow - $allRunning = $false - $retryCount = 0 - $maxRetries = 30 - - do { - Start-Sleep -Seconds 5 - $retryCount++ - - $backendHealth = docker inspect --format='{{.State.Health.Status}}' myp-backend 2>$null - $frontendHealth = docker inspect --format='{{.State.Health.Status}}' myp-rp 2>$null - - if ($backendHealth -eq "healthy" -and $frontendHealth -eq "healthy") { - $allRunning = $true - } - - if ($retryCount -gt $maxRetries) { - Write-Host "Zeitรผberschreitung beim Warten auf Container. Bitte รผberprรผfen Sie den Status mit 'docker ps'." -ForegroundColor Yellow - break - } - } while (-not $allRunning) - - if ($allRunning) { - Write-Host "Alle MYP-Container sind bereit und laufen." -ForegroundColor Green - } -} - -# Informationen zur Anwendung anzeigen -Write-Host "`nMYP-Anwendung ist jetzt verfรผgbar unter:" -ForegroundColor Cyan -Write-Host " * http://localhost" -ForegroundColor White -Write-Host " * http://192.168.0.5:5000 (Backend API direkt)" -ForegroundColor White -Write-Host "`nDas Backend ist unter der festen IP 192.168.0.5 erreichbar." -ForegroundColor Cyan -Write-Host "Die API kann รผber http://localhost/api/ angesprochen werden." -ForegroundColor Cyan -Write-Host "`nOpenSSH Server ist aktiviert und wird beim Systemstart automatisch gestartet." -ForegroundColor Cyan - -Write-Host "`nZum Beenden der Anwendung verwenden Sie: docker-compose down" -ForegroundColor Yellow \ No newline at end of file + exit $ExitCode +} catch { + Write-ColorOutput "`n๐Ÿ’ฅ Unerwarteter Fehler beim Start:" "Error" + Write-ColorOutput " $($_.Exception.Message)" "Error" + exit 1 +} \ No newline at end of file