Dockerfile: simplify - clone emdash source, build all packages, copy with -L flag
Changes: - Build all packages (core, auth, blocks, admin) from source - Copy packages with -L dereferencing symlinks so deps resolve properly - Use emdash@0.9.0 from npm (source packages include their own deps) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
18
Dockerfile
18
Dockerfile
@@ -16,23 +16,25 @@ WORKDIR /app
|
|||||||
RUN git clone --depth=1 https://git.moreminimore.com/kunthawat/emdash-patch-imageupload.git emdash-source
|
RUN git clone --depth=1 https://git.moreminimore.com/kunthawat/emdash-patch-imageupload.git emdash-source
|
||||||
WORKDIR /app/emdash-source
|
WORKDIR /app/emdash-source
|
||||||
|
|
||||||
# Build only the core package directly (not via workspace filter)
|
# Build all packages
|
||||||
RUN corepack enable && corepack prepare pnpm@9.0.0 --activate
|
RUN corepack enable && corepack prepare pnpm@9.0.0 --activate
|
||||||
RUN pnpm install
|
RUN pnpm install
|
||||||
RUN cd packages/core && pnpm build
|
RUN cd packages/core && pnpm build
|
||||||
RUN cd packages/auth && pnpm build
|
RUN cd packages/auth && pnpm build
|
||||||
|
RUN cd packages/blocks && pnpm install && pnpm build
|
||||||
|
RUN cd packages/admin && pnpm build
|
||||||
|
|
||||||
# Return to app and copy source
|
# Return to app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Remove old emdash packages and replace with patched source
|
# Replace emdash packages with source versions (dereference to resolve symlinks)
|
||||||
RUN rm -rf node_modules/emdash node_modules/@emdash-cms/auth
|
RUN rm -rf node_modules/emdash node_modules/@emdash-cms/auth node_modules/@emdash-cms/admin node_modules/@emdash-cms/blocks
|
||||||
RUN cp -r /app/emdash-source/packages/core node_modules/emdash
|
RUN cp -rL emdash-source/packages/core node_modules/emdash
|
||||||
RUN cp -r /app/emdash-source/packages/auth node_modules/@emdash-cms/auth
|
RUN cp -rL emdash-source/packages/auth node_modules/@emdash-cms/auth
|
||||||
# Reinstall so auth's node_modules dependencies are linked
|
RUN cp -rL emdash-source/packages/admin node_modules/@emdash-cms/admin
|
||||||
RUN pnpm install
|
RUN cp -rL emdash-source/packages/blocks node_modules/@emdash-cms/blocks
|
||||||
|
|
||||||
RUN pnpm build && mkdir -p storage/uploads
|
RUN pnpm build && mkdir -p storage/uploads
|
||||||
|
|
||||||
|
|||||||
@@ -18,13 +18,18 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/node": "^10.0.0",
|
"@astrojs/node": "^10.0.0",
|
||||||
"@astrojs/react": "^5.0.0",
|
"@astrojs/react": "^5.0.0",
|
||||||
|
"@emdash-cms/admin": "^0.9.0",
|
||||||
"@emdash-cms/plugin-audit-log": "^0.1.1",
|
"@emdash-cms/plugin-audit-log": "^0.1.1",
|
||||||
|
"@lingui/react": "^5.9.4",
|
||||||
"astro": "^6.0.1",
|
"astro": "^6.0.1",
|
||||||
"better-sqlite3": "^12.8.0",
|
"better-sqlite3": "^12.8.0",
|
||||||
"emdash": "^0.8.0",
|
"emdash": "^0.9.0",
|
||||||
"kysely": "^0.27.0",
|
"kysely": "^0.27.0",
|
||||||
"react": "19.2.4",
|
"react": "19.2.4",
|
||||||
"react-dom": "19.2.4"
|
"react-dom": "19.2.4",
|
||||||
|
"react-hotkeys-hook": "^5.2.4",
|
||||||
|
"dompurify": "^3.3.2",
|
||||||
|
"marked": "^17.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@astrojs/check": "^0.9.7"
|
"@astrojs/check": "^0.9.7"
|
||||||
|
|||||||
6
pnpm-lock.yaml
generated
6
pnpm-lock.yaml
generated
@@ -17,6 +17,9 @@ importers:
|
|||||||
'@emdash-cms/plugin-audit-log':
|
'@emdash-cms/plugin-audit-log':
|
||||||
specifier: ^0.1.1
|
specifier: ^0.1.1
|
||||||
version: 0.1.2(emdash@0.8.0(c5fdb61f10733b2502e0080090fb96d5))
|
version: 0.1.2(emdash@0.8.0(c5fdb61f10733b2502e0080090fb96d5))
|
||||||
|
'@lingui/react':
|
||||||
|
specifier: ^5.9.4
|
||||||
|
version: 5.9.5(react@19.2.4)
|
||||||
astro:
|
astro:
|
||||||
specifier: ^6.0.1
|
specifier: ^6.0.1
|
||||||
version: 6.2.1(@types/node@25.6.0)(rollup@4.60.2)(typescript@5.9.3)(yaml@2.8.4)
|
version: 6.2.1(@types/node@25.6.0)(rollup@4.60.2)(typescript@5.9.3)(yaml@2.8.4)
|
||||||
@@ -35,6 +38,9 @@ importers:
|
|||||||
react-dom:
|
react-dom:
|
||||||
specifier: 19.2.4
|
specifier: 19.2.4
|
||||||
version: 19.2.4(react@19.2.4)
|
version: 19.2.4(react@19.2.4)
|
||||||
|
react-hotkeys-hook:
|
||||||
|
specifier: ^5.2.4
|
||||||
|
version: 5.3.0(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@astrojs/check':
|
'@astrojs/check':
|
||||||
specifier: ^0.9.7
|
specifier: ^0.9.7
|
||||||
|
|||||||
Reference in New Issue
Block a user