robustness: split jetstream into own container, add cursor persistence
Jetstream was running backgrounded in the same container as the API server, so crashes went undetected and Docker never restarted it. Now each process runs as a separate docker-compose service with independent restart policies. Also adds cursor persistence to SQLite (saved every 5s) so restarts resume from where they left off, moves event destructuring inside try/catch blocks, and adds global unhandled error/rejection handlers for crash visibility.
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
services:
|
||||
api:
|
||||
# build: .
|
||||
jetstream:
|
||||
image: docker.li212.fr/litenote:latest
|
||||
restart: unless-stopped
|
||||
command: ["sh", "-c", "deno task migrate && deno task jetstream:prod"]
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
- ${DATA_VOLUME:-data}:/data
|
||||
|
||||
api:
|
||||
image: docker.li212.fr/litenote:latest
|
||||
restart: unless-stopped
|
||||
command: ["deno", "task", "server:prod"]
|
||||
ports:
|
||||
- "${PORT}:8080"
|
||||
env_file:
|
||||
|
||||
Reference in New Issue
Block a user