Dependencies like react and react-dom come from the workspace root catalog, not from individual packages. Need to install all workspace packages first so the root node_modules is populated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
44 lines
1.2 KiB
Docker
44 lines
1.2 KiB
Docker
FROM node:22-alpine AS deps
|
|
|
|
RUN apk add --no-cache python3 make g++ sqlite git
|
|
|
|
WORKDIR /app
|
|
|
|
# Clone full emdash monorepo (with patch applied)
|
|
RUN git clone --depth=1 https://git.moreminimore.com/kunthawat/emdash-patch-imageupload.git emdash
|
|
|
|
# Clone blog template source
|
|
RUN git clone --depth=1 https://git.moreminimore.com/kunthawat/emdash-blog-template.git blog-template
|
|
|
|
WORKDIR /app/emdash
|
|
|
|
# Add blog template as workspace package and install all deps
|
|
RUN cp -r /app/blog-template packages/blog-template
|
|
RUN corepack enable && corepack prepare pnpm@9.0.0 --activate
|
|
RUN pnpm install
|
|
|
|
# Build all packages including the blog template
|
|
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
|
|
RUN cd packages/blog-template && pnpm build
|
|
|
|
FROM deps AS runner
|
|
|
|
WORKDIR /app
|
|
|
|
ENV NODE_ENV=production
|
|
ENV HOST=0.0.0.0
|
|
|
|
# Copy full workspace node_modules (pnpm hoists deps at workspace root)
|
|
COPY --from=deps /app/emdash/node_modules ./node_modules
|
|
COPY --from=deps /app/emdash/packages/blog-template/dist ./dist
|
|
|
|
EXPOSE 4321
|
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|