forked from CodeGraphContext/CodeGraphContext
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (57 loc) · 1.86 KB
/
Dockerfile
File metadata and controls
74 lines (57 loc) · 1.86 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Multi-stage build for CodeGraphContext
FROM python:3.12-slim as builder
# Set working directory
WORKDIR /app
# Install system dependencies required for building
RUN apt-get update && apt-get install -y \
gcc \
g++ \
make \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy project files
COPY pyproject.toml README.md LICENSE MANIFEST.in ./
COPY src/ ./src/
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
pip install --no-cache-dir .
# Production stage
FROM python:3.12-slim
# Set working directory
WORKDIR /app
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy installed packages from builder
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=builder /usr/local/bin/cgc /usr/local/bin/cgc
COPY --from=builder /usr/local/bin/codegraphcontext /usr/local/bin/codegraphcontext
# Copy source code
COPY --from=builder /app/src /app/src
# Create directory for code to be indexed
RUN mkdir -p /workspace
# Create directory for database and config
RUN mkdir -p /root/.codegraphcontext
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV CGC_HOME=/root/.codegraphcontext
# Remote FalkorDB connection (set at runtime via docker run -e or docker-compose)
# ENV DATABASE_TYPE=falkordb-remote
# ENV FALKORDB_HOST=
# ENV FALKORDB_PORT=6379
# ENV FALKORDB_PASSWORD=
# ENV FALKORDB_USERNAME=
# ENV FALKORDB_SSL=false
# ENV FALKORDB_GRAPH_NAME=codegraph
# Expose port for potential web interface (future use)
EXPOSE 8080
# Default working directory for user code
WORKDIR /workspace
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD cgc --version || exit 1
# Default command - show help
CMD ["cgc", "help"]