Commit Graph

4 Commits

Author SHA1 Message Date
Kunthawat Greethong
49725b2fd0 refactor: move data.db and uploads to storage/ folder
- Changed database path to ./storage/data.db
- Changed uploads path to ./storage/uploads
- Updated Dockerfile to create storage/uploads dir (not uploads)
- Updated entrypoint.sh to check /app/storage/data.db
- Removed COPY of uploads from builder to runner

Now all persistent data is in /app/storage/:
- /app/storage/data.db (SQLite database)
- /app/storage/uploads/ (uploaded media)

Easypanel mount: emdash-storage → /app/storage

To update EmDash: change version in package.json → push → redeploy

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-02 10:24:03 +07:00
Kunthawat Greethong
30eeee186f fix: improve entrypoint.sh volume mount handling
- Add 3 second delay to wait for Easypanel volume mount
- Check file size as backup (seeded DB > 1KB, empty < 1KB)
- Check content table count as primary validation
- Safer fallback if any check fails

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-02 09:48:40 +07:00
Kunthawat Greethong
a7ba7c81a1 fix: entrypoint seed check handles empty databases
Check for content entries, not just file existence. If data.db
exists but has no content, still run seed to populate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 20:24:30 +07:00
Kunthawat Greethong
f981f1fe4c 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>
2026-04-30 15:00:29 +07:00