Dockerfile: only copy dist/src/package.json from core (avoid circular symlinks)
The -L flag on cp still follows symlinks deeply in this monorepo. Instead copy only dist/ and src/ and package.json directly without -L. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
16
Dockerfile
16
Dockerfile
@@ -16,25 +16,21 @@ 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 all packages
|
# Build core package (contains visual editing toolbar with fix)
|
||||||
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/blocks && pnpm install && pnpm build
|
|
||||||
RUN cd packages/admin && pnpm build
|
|
||||||
|
|
||||||
# Return to app
|
# 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 . .
|
||||||
|
|
||||||
# Replace emdash packages with source versions (dereference to resolve symlinks)
|
# Replace emdash core with patched version (don't copy whole package - it has circular symlinks)
|
||||||
RUN rm -rf node_modules/emdash node_modules/@emdash-cms/auth node_modules/@emdash-cms/admin node_modules/@emdash-cms/blocks
|
RUN rm -rf node_modules/emdash/dist node_modules/emdash/src node_modules/emdash/package.json
|
||||||
RUN cp -rL emdash-source/packages/core node_modules/emdash
|
RUN cp -r emdash-source/packages/core/dist node_modules/emdash/
|
||||||
RUN cp -rL emdash-source/packages/auth node_modules/@emdash-cms/auth
|
RUN cp -r emdash-source/packages/core/src node_modules/emdash/
|
||||||
RUN cp -rL emdash-source/packages/admin node_modules/@emdash-cms/admin
|
RUN cp emdash-source/packages/core/package.json node_modules/emdash/
|
||||||
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user