Two AI components were importing from ../../../../packages/ai/src using relative paths that escape the workspace root. This worked locally because all packages are siblings on disk, but failed in Docker where Dockerfile.web only copies apps/web, packages/database, and packages/shared into the build context — packages/ai never made it in. Changes: - Add @tasks/ai as a workspace dependency in apps/web/package.json - Switch both imports (command-palette.tsx, ai-block.tsx) to "@tasks/ai" - Add @tasks/ai to transpilePackages in next.config.ts and the docker variant - Copy packages/ai into the Docker build context (Dockerfile.web) - Refresh pnpm-lock.yaml for the new workspace edge Verified locally: web builds compile cleanly past the previously failing "Module not found" errors. (Local final step hits an unrelated ENOSPC on the dev disk; Coolify's volume has plenty of headroom.) Made-with: Cursor
56 lines
1.8 KiB
Text
56 lines
1.8 KiB
Text
# syntax=docker/dockerfile:1
|
|
|
|
ARG NODE_VERSION=20.18.1
|
|
FROM node:${NODE_VERSION}-alpine AS base
|
|
RUN corepack enable && corepack prepare pnpm@9.15.0 --activate
|
|
WORKDIR /app
|
|
|
|
# --- Builder ---
|
|
# Install deps + build in one stage so pnpm's per-package node_modules
|
|
# (containing .bin symlinks like `next`, `tsup`) are intact.
|
|
# pnpm's content-addressable store keeps re-installs fast on cache hits.
|
|
FROM base AS builder
|
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml turbo.json tsconfig.json ./
|
|
COPY apps/web/package.json ./apps/web/
|
|
COPY apps/collab-server/package.json ./apps/collab-server/
|
|
COPY apps/mcp-server/package.json ./apps/mcp-server/
|
|
COPY packages/database/package.json ./packages/database/
|
|
COPY packages/shared/package.json ./packages/shared/
|
|
COPY packages/ai/package.json ./packages/ai/
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
COPY apps/web ./apps/web
|
|
COPY packages/ai ./packages/ai
|
|
COPY packages/database ./packages/database
|
|
COPY packages/shared ./packages/shared
|
|
COPY docker/next.config.docker.ts ./apps/web/next.config.ts
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
ENV NODE_ENV=production
|
|
|
|
RUN pnpm exec turbo build --filter=@tasks/web
|
|
|
|
# --- Production runner ---
|
|
FROM node:${NODE_VERSION}-alpine AS runner
|
|
RUN apk add --no-cache wget \
|
|
&& addgroup --system --gid 1001 nodejs \
|
|
&& adduser --system --uid 1001 nextjs
|
|
|
|
WORKDIR /app
|
|
|
|
ENV NODE_ENV=production
|
|
ENV PORT=3000
|
|
ENV HOSTNAME=0.0.0.0
|
|
|
|
COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
|
|
COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
|
|
COPY --from=builder --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
|
|
|
|
USER nextjs
|
|
|
|
EXPOSE 3000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \
|
|
CMD wget -qO- --timeout=3 http://127.0.0.1:3000/ >/dev/null || exit 1
|
|
|
|
CMD ["node", "apps/web/server.js"]
|