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
|
||||
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 pnpm install
|
||||
RUN cd packages/core && 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
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
# Remove old emdash packages and replace with patched source
|
||||
RUN rm -rf node_modules/emdash node_modules/@emdash-cms/auth
|
||||
RUN cp -r /app/emdash-source/packages/core node_modules/emdash
|
||||
RUN cp -r /app/emdash-source/packages/auth node_modules/@emdash-cms/auth
|
||||
# Reinstall so auth's node_modules dependencies are linked
|
||||
RUN pnpm install
|
||||
# Replace emdash packages with source versions (dereference to resolve symlinks)
|
||||
RUN rm -rf node_modules/emdash node_modules/@emdash-cms/auth node_modules/@emdash-cms/admin node_modules/@emdash-cms/blocks
|
||||
RUN cp -rL emdash-source/packages/core node_modules/emdash
|
||||
RUN cp -rL emdash-source/packages/auth node_modules/@emdash-cms/auth
|
||||
RUN cp -rL emdash-source/packages/admin node_modules/@emdash-cms/admin
|
||||
RUN cp -rL emdash-source/packages/blocks node_modules/@emdash-cms/blocks
|
||||
|
||||
RUN pnpm build && mkdir -p storage/uploads
|
||||
|
||||
|
||||
Reference in New Issue
Block a user