From 4fe6e4c2da518d39d40a704d4e2a6913cdef729d Mon Sep 17 00:00:00 2001 From: Viren070 Date: Sat, 12 Jul 2025 16:10:14 +0100 Subject: [PATCH] fix(stremio-letterboxd): only migrate once --- apps/stremio-letterboxd/compose.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/stremio-letterboxd/compose.yaml b/apps/stremio-letterboxd/compose.yaml index c42bb07..e16302d 100644 --- a/apps/stremio-letterboxd/compose.yaml +++ b/apps/stremio-letterboxd/compose.yaml @@ -7,7 +7,7 @@ services: FROM node:22.14.0 ENV NODE_ENV=production - + WORKDIR /app COPY . . @@ -23,13 +23,16 @@ services: # Entrypoint script: create init migration if none exist, run migrations, start app CMD sh -c '\ - if [ ! -d "packages/database/prisma/migrations" ] || [ -z "$(ls -A packages/database/prisma/migrations)" ]; then \ - echo "No migrations found, creating init migration..."; \ - pnpm --filter @stremio-addon/database prisma migrate dev --name init --create-only; \ + if [ ! -f /app/data/migrated ]; then \ + echo "Running init migration..."; \ + pnpm --filter @stremio-addon/database prisma migrate dev --name init; \ + touch /app/data/migrated; \ + else \ + echo "Migration already performed, skipping..."; \ fi && \ - pnpm --filter @stremio-addon/database prisma migrate deploy && \ pnpm start \ ' + container_name: stremio-letterboxd restart: unless-stopped env_file: