version: '3.8' # Coolify-Variante von docker-compose.simple.yml # # Unterschiede zum lokalen File: # 1. Kein "env_file: .env" — Coolify injiziert alle Env-Vars über sein UI # 2. Kein "container_name" — Coolify verwaltet die Container-Namen selbst # 3. Port ohne 127.0.0.1-Bindung — Coolify's Traefik-Proxy übernimmt das Routing # 4. Named volume für Logs statt Host-Pfad # # Coolify-Einrichtung: # - Resource Type: Docker Compose # - Compose File: docker-compose.coolify.yml # - Main Service: linkedin-posts # - Port: 8001 # - Alle Env-Vars (API Keys, Supabase etc.) im Coolify UI setzen services: redis: image: redis:7-alpine restart: unless-stopped command: redis-server --maxmemory 128mb --maxmemory-policy allkeys-lru --save "" labels: - traefik.enable=false healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 3 start_period: 5s linkedin-scheduler: build: . restart: unless-stopped command: python -m src.services.scheduler_runner labels: - traefik.enable=false healthcheck: test: ["CMD", "python", "-c", "import os, time; p=os.getenv('SCHEDULER_HEALTH_FILE','/tmp/scheduler_heartbeat'); raise SystemExit(0 if os.path.exists(p) and time.time() - os.path.getmtime(p) < 120 else 1)"] interval: 30s timeout: 5s retries: 3 start_period: 20s environment: - PYTHONPATH=/app - SCHEDULER_ENABLED=true - REDIS_URL=redis://redis:6379/0 - SCHEDULER_HEALTH_FILE=/tmp/scheduler_heartbeat volumes: - logs:/app/logs depends_on: redis: condition: service_healthy linkedin-posts: build: . restart: unless-stopped command: python -m uvicorn src.web.app:app --host 0.0.0.0 --port 8001 --workers 2 ports: - "8001:8001" environment: - PYTHONPATH=/app - PORT=8001 - SCHEDULER_ENABLED=false - REDIS_URL=redis://redis:6379/0 volumes: - logs:/app/logs depends_on: redis: condition: service_healthy healthcheck: test: ["CMD", "python", "-c", "import httpx; r = httpx.get('http://127.0.0.1:8001/health', timeout=5); raise SystemExit(0 if r.status_code == 200 else 1)"] interval: 30s timeout: 10s retries: 3 start_period: 15s volumes: logs: