-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (35 loc) · 1.36 KB
/
Dockerfile
File metadata and controls
45 lines (35 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
FROM node:20-slim
WORKDIR /app
# Install git for any git operations, docker CLI for sandbox, and curl for CodeRabbit CLI
# Using debian-slim instead of alpine because CodeRabbit CLI requires glibc
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
ca-certificates \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Install CodeRabbit CLI for AI code reviews
# Note: The CLI binary requires glibc (which debian-slim provides natively)
RUN curl -fsSL https://cli.coderabbit.ai/install.sh | bash && \
ls -la /root/.local/bin/ && \
ln -sf /root/.local/bin/coderabbit /usr/local/bin/coderabbit && \
ln -sf /root/.local/bin/coderabbit /usr/local/bin/cr && \
ls -la /usr/local/bin/coderabbit && \
/usr/local/bin/coderabbit --version
# Install dependencies
COPY package*.json ./
RUN npm ci
# Copy source (for production, we'd copy built files)
COPY . .
# Build TypeScript
RUN npm run build
# Create repos directory (will be overwritten by volume mount)
RUN mkdir -p /data/repos
# Expose server port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
# Start server - uses /data/repos which should be a persistent volume
CMD ["node", "dist/cli.js", "serve", "--repos", "/data/repos"]