muthuk1 commited on
Commit
47d8a83
Β·
verified Β·
1 Parent(s): d865094

Add Dockerfile for one-command deployment

Browse files
Files changed (1) hide show
  1. Dockerfile +53 -0
Dockerfile ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ═══════════════════════════════════════════════════════════
2
+ # GraphRAG Inference Hackathon β€” Docker Deployment
3
+ # ═══════════════════════════════════════════════════════════
4
+ # Build: docker build -t graphrag .
5
+ # Run: docker run -p 3000:3000 -e ANTHROPIC_API_KEY=sk-ant-... graphrag
6
+ # ═══════════════════════════════════════════════════════════
7
+
8
+ FROM node:20-slim AS frontend-builder
9
+
10
+ WORKDIR /app/web
11
+ COPY web/package.json web/package-lock.json* ./
12
+ RUN npm install --frozen-lockfile 2>/dev/null || npm install
13
+ COPY web/ ./
14
+ RUN npm run build
15
+
16
+ # ── Production Image ───────────────────────────────────
17
+ FROM node:20-slim AS runner
18
+
19
+ RUN apt-get update && apt-get install -y python3 python3-pip python3-venv && \
20
+ rm -rf /var/lib/apt/lists/*
21
+
22
+ WORKDIR /app
23
+
24
+ # Python backend
25
+ COPY requirements.txt ./
26
+ RUN python3 -m venv /app/venv && \
27
+ /app/venv/bin/pip install --no-cache-dir -r requirements.txt 2>/dev/null || true
28
+
29
+ COPY graphrag/ ./graphrag/
30
+ COPY openclaw/ ./openclaw/
31
+ COPY tests/ ./tests/
32
+
33
+ # Next.js frontend
34
+ COPY --from=frontend-builder /app/web/.next ./web/.next
35
+ COPY --from=frontend-builder /app/web/node_modules ./web/node_modules
36
+ COPY --from=frontend-builder /app/web/package.json ./web/package.json
37
+ COPY --from=frontend-builder /app/web/public ./web/public 2>/dev/null || true
38
+ COPY web/src/ ./web/src/
39
+ COPY web/next.config.ts ./web/
40
+
41
+ # Environment
42
+ ENV NODE_ENV=production
43
+ ENV PATH="/app/venv/bin:$PATH"
44
+ ENV HOSTNAME="0.0.0.0"
45
+
46
+ EXPOSE 3000 7860
47
+
48
+ # Health check
49
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
50
+ CMD curl -f http://localhost:3000/ || exit 1
51
+
52
+ # Default: run Next.js dashboard
53
+ CMD ["sh", "-c", "cd /app/web && npm start -- -p 3000"]