From f10263f99a3ce244951f9ed2f43639da6b422ab3 Mon Sep 17 00:00:00 2001 From: Kunthawat Greethong Date: Sun, 3 May 2026 16:17:10 +0700 Subject: [PATCH] Dockerfile: build blog template as part of emdash monorepo workspace Clones full emdash monorepo (with image upload fix), adds blog template as a workspace package, builds everything together. No package copying required - workspace resolution handles everything. Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 41 ++++++++++++++--------------------------- 1 file changed, 14 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index 80b000a..5c59eec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,45 +4,32 @@ RUN apk add --no-cache python3 make g++ sqlite git WORKDIR /app -COPY package.json pnpm-lock.yaml* ./ -RUN corepack enable && corepack prepare pnpm@9.0.0 --activate -RUN pnpm install +# Clone full emdash monorepo (with patch applied) +RUN git clone --depth=1 https://git.moreminimore.com/kunthawat/emdash-patch-imageupload.git emdash -FROM deps AS builder +# Clone blog template source +RUN git clone --depth=1 https://git.moreminimore.com/kunthawat/emdash-blog-template.git blog-template -WORKDIR /app +WORKDIR /app/emdash -# Clone patched emdash source -RUN git clone --depth=1 https://git.moreminimore.com/kunthawat/emdash-patch-imageupload.git emdash-source -WORKDIR /app/emdash-source +# Add blog template as workspace package +RUN cp -r /app/blog-template packages/blog-template -# Build core package (contains visual editing toolbar with fix) +# Build all packages including the blog template RUN corepack enable && corepack prepare pnpm@9.0.0 --activate RUN pnpm install RUN cd packages/core && pnpm build - -# Return to app -WORKDIR /app -COPY --from=deps /app/node_modules ./node_modules -COPY . . - -# Replace emdash core with patched version (don't copy whole package - it has circular symlinks) -RUN rm -rf node_modules/emdash/dist node_modules/emdash/src node_modules/emdash/package.json -RUN cp -r emdash-source/packages/core/dist node_modules/emdash/ -RUN cp -r emdash-source/packages/core/src node_modules/emdash/ -RUN cp emdash-source/packages/core/package.json node_modules/emdash/ - -RUN pnpm build && mkdir -p storage/uploads +RUN cd packages/auth && pnpm build +RUN cd packages/blocks && pnpm install && pnpm build +RUN cd packages/admin && pnpm build +RUN cd packages/blog-template && pnpm build FROM deps AS runner WORKDIR /app -ENV NODE_ENV=production -ENV HOST=0.0.0.0 - -COPY --from=builder /app/node_modules ./node_modules -COPY --from=builder /app/dist ./dist +COPY --from=deps /app/emdash/packages/blog-template/dist ./dist +COPY --from=deps /app/emdash/packages/blog-template/node_modules ./node_modules EXPOSE 4321