Files
emdash-blog-template/Dockerfile
Kunthawat Greethong 3e9ed743dc Dockerfile: copy node_modules from workspace root (pnpm hoists deps there)
The monorepo workspace roots node_modules at /app/emdash/node_modules,
not in individual packages. Copy from workspace root to get all deps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-03 16:43:28 +07:00

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
RUN cp -r /app/blog-template packages/blog-template
# 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
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"]