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.
24 lines
495 B
YAML
24 lines
495 B
YAML
services:
|
|
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:
|
|
- .env
|
|
volumes:
|
|
- ${DATA_VOLUME:-data}:/data
|
|
|
|
volumes:
|
|
data:
|