CognxSafeTrack commited on
Commit
b6cac0c
Β·
1 Parent(s): 8cd83e2

chore(deploy): split HF Dockerfile for API and Railway Dockerfile for Worker

Browse files
Files changed (2) hide show
  1. Dockerfile +2 -3
  2. apps/whatsapp-worker/Dockerfile +3 -4
Dockerfile CHANGED
@@ -41,9 +41,8 @@ EXPOSE 7860
41
  ENV PORT=7860
42
 
43
  # Force Docker cache invalidation - bump date to trigger clean rebuild
44
- ENV REBUILD_DATE="2026-02-22-api-only"
45
 
46
  # HF = API only (inbound webhook + Prisma + BullMQ enqueue)
47
- # Railway = whatsapp-worker only (BullMQ consumer + outbound graph.facebook.com)
48
- CMD ["sh", "-c", "pnpm --filter @repo/database db:push && tsx apps/api/src/index.ts"]
49
 
 
41
  ENV PORT=7860
42
 
43
  # Force Docker cache invalidation - bump date to trigger clean rebuild
44
+ ENV REBUILD_DATE="2026-02-23-api-only"
45
 
46
  # HF = API only (inbound webhook + Prisma + BullMQ enqueue)
47
+ CMD ["sh", "-c", "node apps/api/dist/src/index.js"]
 
48
 
apps/whatsapp-worker/Dockerfile CHANGED
@@ -22,7 +22,6 @@ ENV NODE_OPTIONS="--dns-result-order=ipv4first"
22
  # Expose the API port (Railway uses PORT env var, default 3001)
23
  EXPOSE 3001
24
 
25
- # ─── Combined startup ─────────────────────────────────────────────────────────
26
- # db:push is best-effort β€” failure must NOT block the API or worker.
27
- # API (webhook + REST) and worker (BullMQ) start in parallel.
28
- CMD ["sh", "-c", "(pnpm --filter @repo/database db:push || echo '[CMD] db:push skipped or failed β€” continuing') && node /app/apps/api/dist/src/index.js & sleep 2 && node /app/apps/whatsapp-worker/dist/src/index.js & wait"]
 
22
  # Expose the API port (Railway uses PORT env var, default 3001)
23
  EXPOSE 3001
24
 
25
+ # ─── Worker startup ─────────────────────────────────────────────────────────
26
+ # Railway = whatsapp-worker only (BullMQ consumer + outbound pedagogy)
27
+ CMD ["sh", "-c", "(pnpm --filter @repo/database db:push || echo '[CMD] db:push skipped') && node /app/apps/whatsapp-worker/dist/src/index.js"]