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