fix: run emdash seed only on first launch via entrypoint.sh
- Remove emdash seed from Dockerfile build stage (no longer overwrites DB) - Add entrypoint.sh that checks if data.db exists before seeding - First launch: seed runs to populate DB - Subsequent redeploys: DB exists, seed skipped, data preserved - Also remove COPY data.db from runner stage (volume mount handles persistence) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,7 @@ WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
RUN pnpm build && pnpm exec emdash init && pnpm exec emdash seed && mkdir -p uploads
|
||||
RUN pnpm build && pnpm exec emdash init && mkdir -p uploads
|
||||
|
||||
FROM deps AS runner
|
||||
|
||||
@@ -26,8 +26,11 @@ ENV HOST=0.0.0.0
|
||||
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/data.db ./data.db
|
||||
COPY --from=builder /app/uploads ./uploads
|
||||
|
||||
EXPOSE 4321
|
||||
|
||||
CMD ["node", "./dist/server/entry.mjs"]
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user