feat: Docker support for L1 server

- Dockerfile for L1 server/worker
- docker-compose.yml with Redis
- Environment variables for Redis URL and cache dir

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-07 12:04:47 +00:00
parent ba20c2dc63
commit 8850ada3be
4 changed files with 91 additions and 5 deletions

View File

@@ -21,16 +21,23 @@ from fastapi.responses import FileResponse
from pydantic import BaseModel
import redis
from urllib.parse import urlparse
from celery_app import app as celery_app
from tasks import render_effect
# Cache directory
CACHE_DIR = Path.home() / ".artdag" / "cache"
# Cache directory (use /data/cache in Docker, ~/.artdag/cache locally)
CACHE_DIR = Path(os.environ.get("CACHE_DIR", str(Path.home() / ".artdag" / "cache")))
CACHE_DIR.mkdir(parents=True, exist_ok=True)
# Redis for persistent run storage
redis_client = redis.Redis(host='localhost', port=6379, db=5)
REDIS_URL = os.environ.get('REDIS_URL', 'redis://localhost:6379/5')
parsed = urlparse(REDIS_URL)
redis_client = redis.Redis(
host=parsed.hostname or 'localhost',
port=parsed.port or 6379,
db=int(parsed.path.lstrip('/') or 0)
)
RUNS_KEY_PREFIX = "artdag:run:"