diff --git a/Dockerfile b/Dockerfile index 0523174..546558a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM node:20-alpine AS builder WORKDIR /app COPY package*.json ./ +COPY scripts/ ./scripts/ RUN npm install COPY tsconfig.json ./ COPY src/ ./src/ @@ -9,7 +10,9 @@ RUN npx tsc FROM node:20-alpine WORKDIR /app COPY package*.json ./ +COPY scripts/ ./scripts/ RUN npm install --omit=dev COPY --from=builder /app/dist ./dist +COPY product/ ./product/ EXPOSE 3456 CMD ["node", "dist/index.js"] diff --git a/hermes-k8s.yaml b/hermes-k8s.yaml index 10eb7d0..1c018d8 100644 --- a/hermes-k8s.yaml +++ b/hermes-k8s.yaml @@ -22,7 +22,7 @@ spec: fsGroup: 1000 containers: - name: hermes-mcp - image: localhost:32000/hermes-mcp@sha256:e169dccdb2a4e670036391658c5718a2244b3e16b7ffb1f71946a9aae10ba151 + image: localhost:32000/hermes-mcp@sha256:17f1f7ce059f0f87d9c34c39e2ea0fb1f25cf72f9279341c5912e6c35690f43a imagePullPolicy: Always securityContext: allowPrivilegeEscalation: false @@ -125,6 +125,8 @@ spec: value: "761c17a9a49670489ccf93ccffd344dbfc642ae994ac2ee991dbb42de3f6c3af" - name: SLACK_PILOT_WEBHOOK_URL value: "https://hooks.slack.com/services/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" + - name: ANTHROPIC_API_KEY + value: "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" volumeMounts: - name: vaults mountPath: /vaults diff --git a/src/index.ts b/src/index.ts index dfdc026..54871ce 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,6 +38,22 @@ import { notifyNewPilotRequest } from './notifications/index.js'; import redis from './redis.js'; import { handleChat, type ChatMessage } from './chat.js'; +process.on('uncaughtException', (err) => { + console.error('FATAL uncaughtException:', err); + if (err && typeof err === 'object') { + console.error('Stack:', (err as Error).stack); + } + process.exit(1); +}); + +process.on('unhandledRejection', (reason, promise) => { + console.error('FATAL unhandledRejection at:', promise, 'reason:', reason); + if (reason && typeof reason === 'object') { + console.error('Stack:', (reason as Error).stack); + } + process.exit(1); +}); + const app = express(); app.use(cookieParser()); app.use(cors({ @@ -58,7 +74,7 @@ app.use(express.urlencoded({ extended: true })); // ── Static files (videos, assets) ────────────────────────────────────────── app.use('/public', express.static('/vaults/public')); -app.use(express.static(new URL('../../product', import.meta.url).pathname)); +app.use(express.static(new URL('../product', import.meta.url).pathname)); // ── Config ───────────────────────────────────────────────────────────────── const PORT = process.env.PORT ?? 3456;