From c26bb3601a6656e98cdca3850b9cea72e1ba0c1c Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Sat, 17 Jan 2026 11:11:26 +0300 Subject: [PATCH] Run migrations at startup and persist DB files Cache drizzle-kit in the image to ensure the migrate command is available, and add host volume mounts for the SQLite DB, WAL, and SHM files so the database state is persisted across container restarts. --- tap/Dockerfile | 4 +++- tap/compose.yaml | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/tap/Dockerfile b/tap/Dockerfile index 3c66993c..ddc93a8f 100644 --- a/tap/Dockerfile +++ b/tap/Dockerfile @@ -5,6 +5,8 @@ RUN curl -fsSL https://deno.land/install.sh | sh ENV DENO_INSTALL="/root/.deno" ENV PATH="$DENO_INSTALL/bin:$PATH" +RUN deno x drizzle-kit --version + WORKDIR /app COPY . . @@ -13,4 +15,4 @@ RUN deno cache src/main.ts EXPOSE 2481 -CMD ["deno", "run", "-A", "src/main.ts"] +CMD ["bash", "-c", "deno x drizzle-kit migrate && deno run -A src/main.ts"] diff --git a/tap/compose.yaml b/tap/compose.yaml index 3a754d1a..edda2106 100644 --- a/tap/compose.yaml +++ b/tap/compose.yaml @@ -1,6 +1,8 @@ services: tap: image: ghcr.io/bluesky-social/indigo/tap:latest + depends_on: + - webhook restart: always ports: - "2480:2480" @@ -15,5 +17,9 @@ services: webhook: build: . restart: always + volumes: + - ./tap-cache.db:/app/tap-cache.db + - ./tap-cache.db-shm:/app/tap-cache.db-shm + - ./tap-cache.db-wal:/app/tap-cache.db-wal ports: - "2481:2481" -- 2.51.2