- 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>
10 lines
286 B
Bash
10 lines
286 B
Bash
#!/bin/sh
|
|
# Only seed on first launch (when data.db doesn't exist)
|
|
if [ ! -f data.db ]; then
|
|
echo "Database missing, running emdash init & seed..."
|
|
pnpm exec emdash init
|
|
pnpm exec emdash seed
|
|
else
|
|
echo "Database exists, starting normally..."
|
|
fi
|
|
exec node ./dist/server/entry.mjs |