Files
michaelschiemer/.deployment-backup/ansible/netcup-simple-deploy/SETUP-COMPOSE.md
Michael Schiemer 9b74ade5b0 feat: Fix discovery system critical issues
Resolved multiple critical discovery system issues:

## Discovery System Fixes
- Fixed console commands not being discovered on first run
- Implemented fallback discovery for empty caches
- Added context-aware caching with separate cache keys
- Fixed object serialization preventing __PHP_Incomplete_Class

## Cache System Improvements
- Smart caching that only caches meaningful results
- Separate caches for different execution contexts (console, web, test)
- Proper array serialization/deserialization for cache compatibility
- Cache hit logging for debugging and monitoring

## Object Serialization Fixes
- Fixed DiscoveredAttribute serialization with proper string conversion
- Sanitized additional data to prevent object reference issues
- Added fallback for corrupted cache entries

## Performance & Reliability
- All 69 console commands properly discovered and cached
- 534 total discovery items successfully cached and restored
- No more __PHP_Incomplete_Class cache corruption
- Improved error handling and graceful fallbacks

## Testing & Quality
- Fixed code style issues across discovery components
- Enhanced logging for better debugging capabilities
- Improved cache validation and error recovery

Ready for production deployment with stable discovery system.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-13 12:04:17 +02:00

3.2 KiB

Projekt Setup für Netcup (nutzt deine docker-compose.yml)

Projektstruktur

Das Deployment nutzt deine bestehende Docker-Konfiguration:

dein-projekt/                  # Hauptordner
├── ansible/                  # Hier sind wir jetzt
│   └── netcup-simple-deploy/
├── docker-compose.yml        # ← DEINE Compose-Datei (wird verwendet!)
├── docker/                   # Docker-Konfiguration
│   ├── Dockerfile            
│   └── docker-compose.yml    # ← Alternative hier
├── src/                      # PHP Framework/Library Dateien
├── public/                   # Web-Root
└── ...

Was das Deployment macht:

Nutzt deine bestehende docker-compose.yml Startet ALLE deine Services (DB, Redis, etc.) Überträgt komplettes Projekt Nginx als Reverse Proxy für SSL

Quick Setup

1. Konfiguration

cd ansible/netcup-simple-deploy
vim inventory/hosts.yml

Wichtig ändern:

ansible_host: DEINE-NETCUP-IP
domain: "deine-domain.com"
app_port: 8080                 # Port deiner App aus docker-compose.yml

2. Port prüfen

Schaue in deine docker-compose.yml welchen Port deine App exponiertrt:

services:
  myapp:
    ports:
      - "8080:80"  # ← Dann ist app_port: 8080

3. Deployment

make deploy

Beispiel docker-compose.yml Strukturen

Einfache PHP App

version: '3.8'
services:
  web:
    build: .
    ports:
      - "8080:80"
    volumes:
      - ./src:/var/www/src
      - ./public:/var/www/html

Mit Datenbank

version: '3.8'
services:
  web:
    build: .
    ports:
      - "8080:80"
    depends_on:
      - db
    environment:
      - DATABASE_URL=mysql://user:pass@db:3306/myapp
      
  db:
    image: mysql:8.0
    environment:
      - MYSQL_ROOT_PASSWORD=secret
      - MYSQL_DATABASE=myapp
    volumes:
      - db_data:/var/lib/mysql

volumes:
  db_data:

Mit Redis + Database

version: '3.8'
services:
  web:
    build: .
    ports:
      - "8080:80"
    depends_on:
      - db
      - redis
      
  db:
    image: postgres:15
    environment:
      - POSTGRES_DB=myapp
      - POSTGRES_USER=user
      - POSTGRES_PASSWORD=secret
    volumes:
      - postgres_data:/var/lib/postgresql/data
      
  redis:
    image: redis:7-alpine
    volumes:
      - redis_data:/data

volumes:
  postgres_data:
  redis_data:

Nach dem Deployment

Alle Services verwalten:

make services        # Zeige alle Services
make logs-service    # Logs für bestimmten Service
make status          # Status aller Container
make shell           # In Container einsteigen

Updates:

# Nach Änderungen an Code oder docker-compose.yml
make deploy

# Nur Container neu bauen
make rebuild

Monitoring:

make logs            # Alle Logs
make tail-logs       # Live logs
make show-env        # Environment variables

Vorteile dieser Lösung

Deine bestehende Konfiguration wird verwendet Alle Services (DB, Redis, etc.) funktionieren Keine Code-Änderungen nötig SSL-Termination durch nginx Einfache Updates mit make deploy

Das Deployment ist jetzt vollständig auf deine bestehende Docker-Infrastruktur ausgerichtet! 🎉