Skip to content
Open
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
23 changes: 16 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,31 @@ COPY packages/core/package.json packages/core/tsconfig.json ./packages/core/
COPY packages/mcp/package.json packages/mcp/tsconfig.json ./packages/mcp/
COPY packages/detectors/package.json packages/detectors/tsconfig.json ./packages/detectors/
COPY packages/cli/package.json packages/cli/tsconfig.json ./packages/cli/
COPY packages/cortex/package.json packages/cortex/tsconfig.json ./packages/cortex/

# Create minimal workspace config for just the packages we need
RUN echo 'packages:\n - "packages/core"\n - "packages/detectors"\n - "packages/mcp"\n - "packages/cli"' > pnpm-workspace.yaml
RUN echo 'packages:\n - "packages/core"\n - "packages/detectors"\n - "packages/mcp"\n - "packages/cli"\n - "packages/cortex"' > pnpm-workspace.yaml

# Install all dependencies
RUN pnpm install --frozen-lockfile
RUN pnpm install

# Copy source code
COPY packages/core/src ./packages/core/src
COPY packages/mcp/src ./packages/mcp/src
COPY packages/detectors/src ./packages/detectors/src
COPY packages/cli/src ./packages/cli/src
COPY packages/cortex/src ./packages/cortex/src

# Build core first (other packages depend on it)
# Build detectors first (core and mcp depend on it)
RUN cd packages/detectors && pnpm build

# Build core (depends on detectors)
RUN cd packages/core && pnpm build

# Build detectors (depends on core)
RUN cd packages/detectors && pnpm build
# Build cortex
RUN cd packages/cortex && pnpm build

# Build mcp (depends on core and detectors)
# Build mcp (depends on core, detectors, and cortex)
RUN cd packages/mcp && pnpm build

# Prune dev dependencies after build
Expand Down Expand Up @@ -73,9 +78,13 @@ COPY --from=builder /app/packages/mcp/node_modules ./packages/mcp/node_modules
COPY --from=builder /app/packages/detectors/package.json ./packages/detectors/
COPY --from=builder /app/packages/detectors/dist ./packages/detectors/dist
COPY --from=builder /app/packages/detectors/node_modules ./packages/detectors/node_modules
COPY --from=builder /app/packages/cortex/package.json ./packages/cortex/
COPY --from=builder /app/packages/cortex/dist ./packages/cortex/dist
COPY --from=builder /app/packages/cortex/node_modules ./packages/cortex/node_modules

# Create directory for mounting projects
RUN mkdir -p /project && chown drift:drift /project
RUN mkdir -p /workspace && chown drift:drift /workspace

# Switch to non-root user
USER drift
Expand All @@ -96,4 +105,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD node -e "fetch('http://localhost:${PORT}/health').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"

# Run the HTTP server
CMD ["node", "packages/mcp/dist/bin/http-server.js"]
CMD ["node", "packages/mcp/dist/bin/http-server.js", "--verbose"]
2 changes: 2 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@
"tree-sitter-python": "^0.21.0",
"tree-sitter-rust": "^0.21.0",
"tree-sitter-typescript": "^0.21.2",
"better-sqlite3": "^11.10.0",
"typescript": "^5.3.0"
},
"optionalDependencies": {
"driftdetect-native": "0.9.45"
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.13",
"@types/minimatch": "^5.1.2",
"@types/node": "^20.19.30",
"@vitest/coverage-v8": "^1.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/mcp/src/infrastructure/tool-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const CORE_TOOLS = [

// Discovery
'drift_status',
'drift_setup',
'drift_capabilities',
'drift_projects',

Expand Down