@timmeck/marketing-brain 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/Dockerfile +34 -7
  2. package/package.json +1 -1
package/Dockerfile CHANGED
@@ -1,22 +1,49 @@
1
- FROM node:22-slim
1
+ # Build from monorepo root: docker build -f packages/marketing-brain/Dockerfile .
2
+ FROM node:20-slim AS build
2
3
 
3
4
  # better-sqlite3 needs build tools
4
5
  RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
5
6
 
6
7
  WORKDIR /app
7
8
 
9
+ # Install dependencies (copy package files first for layer caching)
8
10
  COPY package.json package-lock.json ./
9
- RUN npm ci --omit=dev
11
+ COPY packages/brain-core/package.json ./packages/brain-core/
12
+ COPY packages/marketing-brain/package.json ./packages/marketing-brain/
13
+ RUN npm ci --production=false
10
14
 
11
- COPY dist/ dist/
12
- COPY dashboard.html ./
15
+ # Build brain-core first (marketing-brain depends on it)
16
+ COPY tsconfig.base.json ./
17
+ COPY packages/brain-core/ ./packages/brain-core/
18
+ RUN npm run build -w packages/brain-core
19
+
20
+ # Build marketing-brain
21
+ COPY packages/marketing-brain/ ./packages/marketing-brain/
22
+ RUN npm run build -w packages/marketing-brain
23
+
24
+ # Production stage
25
+ FROM node:20-slim
26
+
27
+ RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
28
+
29
+ WORKDIR /app
30
+
31
+ COPY --from=build /app/node_modules ./node_modules
32
+ COPY --from=build /app/packages/brain-core/dist ./packages/brain-core/dist
33
+ COPY --from=build /app/packages/brain-core/package.json ./packages/brain-core/
34
+ COPY --from=build /app/packages/marketing-brain/dist ./packages/marketing-brain/dist
35
+ COPY --from=build /app/packages/marketing-brain/package.json ./packages/marketing-brain/
36
+ COPY --from=build /app/packages/marketing-brain/dashboard.html ./packages/marketing-brain/
13
37
  COPY package.json ./
14
38
 
15
39
  # Data directory for marketing-brain.db
16
40
  RUN mkdir -p /data
17
41
  ENV MARKETING_BRAIN_DATA_DIR=/data
18
42
 
19
- EXPOSE 7781 7782
43
+ EXPOSE 7781 7782 7783
44
+
45
+ HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=10s \
46
+ CMD node -e "require('http').get('http://localhost:7781/api/stats', r => process.exit(r.statusCode === 200 ? 0 : 1))" || exit 1
20
47
 
21
- ENTRYPOINT ["node", "dist/index.js"]
22
- CMD ["mcp-server"]
48
+ ENTRYPOINT ["node", "packages/marketing-brain/dist/index.js"]
49
+ CMD ["daemon"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timmeck/marketing-brain",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Self-learning marketing intelligence system with Hebbian synapse network",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",