Diagnosed via Space run logs: Celery worker crash-looped every ~9s
("broker_connection_retry_on_startup=False ... Shutting down") because the
Upstash start-redis provisioning did not succeed from the Space network, so
the broker fell back to localhost with nothing listening and the container
never became READY.
- Dockerfile(s): install redis-server; entrypoint starts a volatile local
sidecar (port 6379, 120mb LRU) and wires cache/broker/result to
redis://127.0.0.1:6379/{0,1,2} after a PING gate
- Space secrets still win (REDIS_URL/CELERY_BROKER_URL/CELERY_RESULT_BACKEND)
- Upstash free-tier provisioning kept only as last-resort fallback
- Celery: retry broker connect on startup (survive sidecar cold start)
- Entrypoint supervisor: restart sidecar/worker if they die; skip worker
entirely when no broker exists
Co-Authored-By: Claude Code <noreply@anthropic.com>