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.
18 lines
248 B
Docker
18 lines
248 B
Docker
FROM denoland/deno:latest
|
|
|
|
WORKDIR /app
|
|
|
|
COPY deno.json deno.lock ./
|
|
RUN deno install
|
|
|
|
COPY . .
|
|
RUN deno cache jetstream.ts server.ts
|
|
|
|
RUN mkdir -p /data
|
|
VOLUME /data
|
|
ENV SQLITE_PATH=/data/notes.db
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["deno", "task", "server:prod"]
|