added scalability and performance improvements (redis, http caching etc)

This commit is contained in:
2026-02-19 17:19:41 +01:00
parent d8d054c9a8
commit 4b15b552d6
12 changed files with 763 additions and 88 deletions

View File

@@ -1,22 +1,54 @@
version: '3.8'
services:
redis:
image: redis:7-alpine
container_name: linkedin-redis
restart: unless-stopped
command: redis-server --maxmemory 128mb --maxmemory-policy allkeys-lru --save ""
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
linkedin-scheduler:
build: .
container_name: linkedin-scheduler
restart: unless-stopped
command: sh -c "python -m src.services.scheduler_runner"
env_file: .env
environment:
- PYTHONPATH=/app
- SCHEDULER_ENABLED=true
- REDIS_URL=redis://redis:6379/0
volumes:
- ./logs:/app/logs
depends_on:
redis:
condition: service_healthy
linkedin-posts:
build: .
container_name: linkedin-posts
restart: unless-stopped
command: sh -c "python -m uvicorn src.web.app:app --host 0.0.0.0 --port ${PORT:-8001} --workers 2"
ports:
- "127.0.0.1:8001:8001" # Nur lokal erreichbar
env_file:
- .env
- "127.0.0.1:8001:8001"
env_file: .env
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; httpx.get('http://localhost:8001/login', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
start_period: 15s