Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
inject-workspace-packages=true
39 changes: 23 additions & 16 deletions apps/watcher/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
FROM node:22-slim
FROM node:22-slim AS build

WORKDIR /app

# Copy built artifacts from monorepo build
# These should be built before docker build with: pnpm build
# Copy monorepo root files
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json .npmrc* ./

# Copy workspace package manifests
COPY apps/watcher/package.json ./apps/watcher/
COPY packages/shared/package.json ./packages/shared/
COPY packages/backend/package.json ./packages/backend/

# Watcher
COPY apps/watcher/dist/ ./dist/
# Install pnpm and fetch dependencies
RUN corepack enable && corepack prepare pnpm@latest --activate
RUN pnpm install --frozen-lockfile

# Shared package (squadhub client)
COPY packages/shared/package.json ./node_modules/@clawe/shared/package.json
COPY packages/shared/dist/ ./node_modules/@clawe/shared/dist/
# Copy source and build
COPY packages/shared/ ./packages/shared/
COPY packages/backend/ ./packages/backend/
COPY apps/watcher/ ./apps/watcher/
RUN pnpm build --filter=@clawe/watcher

# Backend (Convex API types)
COPY packages/backend/package.json ./node_modules/@clawe/backend/package.json
COPY packages/backend/convex/_generated/ ./node_modules/@clawe/backend/convex/_generated/
COPY packages/backend/convex/*.ts ./node_modules/@clawe/backend/convex/
# Deploy: extract watcher with all production deps into /app/deploy
RUN pnpm --filter=@clawe/watcher --prod deploy deploy

# Create a clean package.json without workspace:* references (npm doesn't support them)
RUN echo '{"name":"@clawe/watcher","private":true,"type":"module"}' > package.json
# --- Production image ---
FROM node:22-slim

WORKDIR /app

# Install production dependencies
RUN npm install convex axios ws moment-timezone --omit=dev
COPY --from=build /app/deploy .

ENV NODE_ENV=production

Expand Down
3 changes: 1 addition & 2 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ WORKDIR /app

# Prune monorepo to only web's dependencies
FROM base AS pruner
RUN npm install -g turbo@2
COPY . .
RUN turbo prune @clawe/web --docker
RUN pnpm dlx turbo prune @clawe/web --docker

# Install dependencies (cached unless package.json/lockfile changes)
FROM base AS deps
Expand Down
2 changes: 1 addition & 1 deletion scripts/convex-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ if [ -n "$WATCHER_TOKEN" ]; then
fi

# Deploy Convex functions and schema
pnpm --filter @clawe/backend deploy
pnpm --filter @clawe/backend run deploy

echo "==> Convex deployment complete"