From e76d81cfce77983a8fb4da09d56ae520d6cec524 Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov <1517853+kpavlov@users.noreply.github.com> Date: Fri, 17 Jul 2026 12:42:14 +0300 Subject: [PATCH] feat: Add basic Dockerfile and docs (#1261) - #1261: Add basic Dockerfile and instructions how to run it Similar docker image was published here: https://hub.docker.com/repository/docker/kernoio/codegraph --- Dockerfile | 12 +++++++++++ .../docs/getting-started/quickstart.md | 20 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..1466cc4e0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:24-slim@sha256:6f7b03f7c2c8e2e784dcf9295400527b9b1270fd37b7e9a7285cf83b6951452d + +ENV CODEGRAPH_TELEMETRY=0 +ENV DO_NOT_TRACK=1 + +WORKDIR /workspace + +ARG CODEGRAPH_VERSION=1.4.1 +RUN npm install -g @colbymchenry/codegraph@${CODEGRAPH_VERSION} && npm cache clean --force + +ENTRYPOINT ["codegraph"] +CMD ["serve", "--mcp"] diff --git a/site/src/content/docs/getting-started/quickstart.md b/site/src/content/docs/getting-started/quickstart.md index e1ea543f0..0e2279b27 100644 --- a/site/src/content/docs/getting-started/quickstart.md +++ b/site/src/content/docs/getting-started/quickstart.md @@ -37,3 +37,23 @@ codegraph init `codegraph init` creates the local `.codegraph/` directory and builds the full graph in the same step — one command, done. Your agent will use CodeGraph tools automatically when a `.codegraph/` directory exists. Next: build [Your First Graph](/codegraph/getting-started/your-first-graph/), or see the full [Installation](/codegraph/getting-started/installation/) options. + + +## 4. Running in Docker + +You can also build a CodeGraph Docker image: + +```bash +VERSION="1.4.1" # pick the latest version +docker build --build-arg CODEGRAPH_VERSION="$VERSION" -f Dockerfile -t colbymchenry/codegraph . +``` + +To run a CodeGraph CLI command, add it at the end, e.g. for `codegraph init` run: +```bash +docker run --rm -i --init -v "$(pwd)":/workspace:rw colbymchenry/codegraph init +``` + +Run the CodeGraph MCP server: +```bash +docker run --rm -i --init -v "$(pwd)":/workspace:rw colbymchenry/codegraph +```