Commit Graph

27 Commits

Author SHA1 Message Date
Kunthawat Greethong
b3c4abcf85 Dockerfile: copy full @emdash-cms/auth package not just dist/
The exports map in package.json is needed at build time to resolve
"@emdash-cms/auth/adapters/kysely". Copying just dist/ loses the
exports field in package.json causing resolution to fail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 11:56:46 +07:00
Kunthawat Greethong
e3dbfc44fa Dockerfile: build auth package and copy only dist folder
The @emdash-cms/auth package needs its built dist/ folder copied,
not the raw src. Also builds auth package after core.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 11:51:19 +07:00
Kunthawat Greethong
defc69be91 Dockerfile: also copy @emdash-cms/auth package from patched source
Resolves build error: Rollup failed to resolve import
"@emdash-cms/auth/adapters/kysely" from emdash middleware.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 11:48:14 +07:00
Kunthawat Greethong
55fecd15c5 Dockerfile: replace entire emdash package with patched source 2026-05-03 11:31:27 +07:00
Kunthawat Greethong
6210f9c5c5 Dockerfile: only replace emdash dist contents, not entire package 2026-05-03 11:19:20 +07:00
Kunthawat Greethong
7e69efae5b Dockerfile: build core package directly instead of using workspace filter 2026-05-03 11:15:43 +07:00
Kunthawat Greethong
9df25848dd Dockerfile: fix build filter to use 'emdash' package name 2026-05-03 11:09:24 +07:00
Kunthawat Greethong
7036f9ef42 Dockerfile: clone, build and install patched emdash source 2026-05-03 11:01:21 +07:00
Kunthawat Greethong
f8e8e2207b Dockerfile: clone patched emdash from gitea instead of using npm
Patches visual editor image upload fix from:
https://git.moreminimore.com/kunthawat/emdash-patch-imageupload.git
2026-05-03 10:52:12 +07:00
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
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
Kunthawat Greethong
6327f87a4c chore: ensure uploads directory exists at container startup
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 09:25:54 +07:00
Kunthawat Greethong
620c63951f Remove user creation and chown (Easypanel manages permissions differently)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 20:45:47 +07:00
Kunthawat Greethong
e8d4e3e767 Chown entire /app directory to astro user for write access
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 20:32:35 +07:00
Kunthawat Greethong
620cfb0371 Create astro user BEFORE copying data.db, fix chown order
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 19:58:28 +07:00
Kunthawat Greethong
7064a17716 Use numeric UID 1001 instead of username for chown
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 18:28:04 +07:00
Kunthawat Greethong
f5b402f272 Chown data.db to astro user to fix readonly database error
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 18:13:19 +07:00
Kunthawat Greethong
aca07743a1 Fix sqlite3 -> sqlite (Alpine package name)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 16:50:43 +07:00
Kunthawat Greethong
346c8003fa Add sqlite3 to builder for database debugging
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 16:45:53 +07:00
Kunthawat Greethong
de4bc34019 Copy data.db from builder to runner (emdash init creates it at build time)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 15:51:38 +07:00
Kunthawat Greethong
2d67a53685 Run emdash seed after init to populate content and initialize the system
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 15:17:33 +07:00
Kunthawat Greethong
fcf4803b29 Set HOST env var so emdash/astro binds to 0.0.0.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 14:43:23 +07:00
Kunthawat Greethong
6d52b7d39c Bind node server to 0.0.0.0 for Docker accessibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 14:19:47 +07:00
Kunthawat Greethong
a458082c5d Run emdash init at build time to initialize database before runtime
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 13:25:04 +07:00
Kunthawat Greethong
854013cd43 Remove non-existent public and data.db from Dockerfile (generated at runtime)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 12:51:54 +07:00
Kunthawat Greethong
ccc1e33bbe Update Dockerfile: node:20 -> node:22 (Astro requires >=22.12.0)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 12:47:52 +07:00
Kunthawat Greethong
520c5f19e2 Initial commit: EmDash blog template
Fixed index.astro: escaped curly braces in code display block
to prevent Astro parser misinterpreting them as expressions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-29 12:41:59 +07:00