diff --git a/README.md b/README.md index 0fc70f2e..86375cb3 100644 --- a/README.md +++ b/README.md @@ -72,15 +72,22 @@ https://github.com/user-attachments/assets/31ec0669-707d-4e03-b511-1bc33d44197a # Deploy Sourcebot -Sourcebot can be deployed in seconds using our official docker image. Visit our [docs](https://docs.sourcebot.dev/docs/deployment-guide) for more information. +Sourcebot can be deployed in seconds using Docker Compose. Visit our [docs](https://docs.sourcebot.dev/docs/deployment/docker-compose) for more information. -1. Create a config +1. Download the docker-compose.yml file +```sh +curl -o docker-compose.yml https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/docker-compose.yml +``` + +2. In the same directory as the `docker-compose.yml` file, create a [configuration file](https://docs.sourcebot.dev/docs/configuration/config-file). The configuration file is a JSON file that configures Sourcebot's behaviour, including what repositories to index, language model providers, auth providers, and more. ```sh touch config.json echo '{ "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json", + // Comments are supported. + // This config creates a single connection to GitHub.com that + // indexes the Sourcebot repository "connections": { - // Comments are supported "starter-connection": { "type": "github", "repos": [ @@ -91,30 +98,12 @@ echo '{ }' > config.json ``` -2. Run the docker container +3. Update the secrets in the `docker-compose.yml` and then run Sourcebot using: ```sh -docker run \ - -p 3000:3000 \ - --pull=always \ - --rm \ - -v $(pwd):/data \ - -e CONFIG_PATH=/data/config.json \ - --name sourcebot \ - ghcr.io/sourcebot-dev/sourcebot:latest +docker compose up ``` -
-What does this command do? -- Pull and run the Sourcebot docker image from [ghcr.io/sourcebot-dev/sourcebot:latest](https://github.com/sourcebot-dev/sourcebot/pkgs/container/sourcebot). -- Mount the current directory (`-v $(pwd):/data`) to allow Sourcebot to persist the `.sourcebot` cache. -- Clones sourcebot at `HEAD` into `.sourcebot/github/sourcebot-dev/sourcebot`. -- Indexes sourcebot into a .zoekt index file in `.sourcebot/index/`. -- Map port 3000 between your machine and the docker image. -- Starts the web server on port 3000. -
-
- -3. Visit `http://localhost:3000` to start using Sourcebot +4. Visit `http://localhost:3000` to start using Sourcebot
To configure Sourcebot (index your own repos, connect your LLMs, etc), check out our [docs](https://docs.sourcebot.dev/docs/configuration/config-file). diff --git a/docs/docs.json b/docs/docs.json index 441f4139..71ebc7e8 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -21,7 +21,13 @@ "group": "Getting Started", "pages": [ "docs/overview", - "docs/deployment-guide" + { + "group": "Deployment", + "pages": [ + "docs/deployment/docker-compose", + "docs/deployment/k8s" + ] + } ] }, { diff --git a/docs/docs/configuration/environment-variables.mdx b/docs/docs/configuration/environment-variables.mdx index 1fc78e2f..fcf90eb4 100644 --- a/docs/docs/configuration/environment-variables.mdx +++ b/docs/docs/configuration/environment-variables.mdx @@ -3,7 +3,7 @@ title: Environment variables sidebarTitle: Environment variables --- -This page provides a detailed reference of all environment variables supported by Sourcebot. If you're just looking to get up and running, we recommend starting with the [deployment guide](/docs/deployment-guide) instead. +This page provides a detailed reference of all environment variables supported by Sourcebot. If you're just looking to get up and running, we recommend starting with the [deployment guides](/docs/deployment/docker-compose) instead. ### Core Environment Variables The following environment variables allow you to configure your Sourcebot deployment. diff --git a/docs/docs/deployment-guide.mdx b/docs/docs/deployment-guide.mdx deleted file mode 100644 index 3a783907..00000000 --- a/docs/docs/deployment-guide.mdx +++ /dev/null @@ -1,82 +0,0 @@ ---- -title: "Deployment guide" ---- - -import SupportedPlatforms from '/snippets/platform-support.mdx' - -Sourcebot is distributed as a [single docker container](/docs/overview#architecture) that can be deployed to a k8s cluster, a VM, or any platform that supports docker. The following guide will walk you through the steps to deploy Sourcebot locally using [Docker compose](https://docs.docker.com/compose). - - -Hit an issue? Please let us know on [GitHub](https://github.com/sourcebot-dev/sourcebot/issues/new) or by [emailing us](mailto:team@sourcebot.dev). - -## Walkthrough ---- - - - - - docker & docker compose -> use [Docker Desktop](https://www.docker.com/products/docker-desktop/) on Mac or Windows. - - - Download the [docker-compose.yml](https://github.com/sourcebot-dev/sourcebot/blob/main/docker-compose.yml) file from the Sourcebot repository. - - ```bash wrap icon="terminal" - curl -o docker-compose.yml https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/docker-compose.yml - ``` - - - Create a `config.json` file that tells Sourcebot which repositories to sync and index: - - ```bash wrap icon="terminal" Create example config - touch config.json - echo '{ - "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json", - "connections": { - // comments are supported - "starter-connection": { - "type": "github", - "repos": [ - "sourcebot-dev/sourcebot" - ] - } - } - }' > config.json - ``` - - This config creates a single GitHub connection named `starter-connection` that specifies [Sourcebot](https://github.com/sourcebot-dev/sourcebot) as a repo to sync. [Learn more about the config file](/docs/configuration/config-file). - - - - If you're deploying Sourcebot behind a domain, you must set the [AUTH_URL](/docs/configuration/environment-variables) environment variable. - - Launch your Sourcebot instance: - - ```bash wrap icon="terminal" - docker compose up -d - ``` - - - - Navigate to [http://localhost:3000](http://localhost:3000) and complete the onboarding flow. - - - - You're all set! If you'd like to setup [Ask Sourcebot](/docs/features/ask/overview), configure a language model [provider](/docs/configuration/language-model-providers). - - - -Checkout the [configuration docs](/docs/configuration/environment-variables) to learn more about how to configure your deployment. - -## Next steps ---- - - - - Learn how to index your code using Sourcebot - - - Learn how to configure language model providers to start using [Ask Sourcebot](/docs/features/ask/overview) - - - Learn more about how to setup SSO, email codes, and other authentication providers. - - \ No newline at end of file diff --git a/docs/docs/deployment/docker-compose.mdx b/docs/docs/deployment/docker-compose.mdx new file mode 100644 index 00000000..b3ff92d4 --- /dev/null +++ b/docs/docs/deployment/docker-compose.mdx @@ -0,0 +1,61 @@ +--- +title: "Docker Compose" +--- + +This guide will walk you through deploying Sourcebot locally or on a VM using Docker Compose. We will use the [docker-compose.yml](https://github.com/sourcebot-dev/sourcebot/blob/main/docker-compose.yml) file from the Sourcebot repository. This is the simplest way to get started with Sourcebot. + +If you are looking to deploy onto Kubernetes, see the [Kubernetes (Helm)](/docs/deployment/k8s) guide. + +## Get started + + + + - docker & docker compose. Use [Docker Desktop](https://www.docker.com/products/docker-desktop/) on Mac or Windows. + + + Download the [docker-compose.yml](https://github.com/sourcebot-dev/sourcebot/blob/main/docker-compose.yml) file from the Sourcebot repository. + + ```bash wrap icon="terminal" + curl -o docker-compose.yml https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/docker-compose.yml + ``` + + + + + In the same directory as the `docker-compose.yml` file, create a [configuration file](/docs/configuration/config-file). The configuration file is a JSON file that configures Sourcebot's behaviour, including what repositories to index, language model providers, auth providers, and more. + + ```bash wrap icon="terminal" Create example config + touch config.json + echo '{ + "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json", + // Comments are supported. + // This config creates a single connection to GitHub.com that + // indexes the Sourcebot repository + "connections": { + "starter-connection": { + "type": "github", + "repos": [ + "sourcebot-dev/sourcebot" + ] + } + } + }' > config.json + ``` + + + + Update the secrets in the `docker-compose.yml` and then run Sourcebot using: + + ```bash wrap icon="terminal" + docker compose up + ``` + + + + You're all set! Navigate to [http://localhost:3000](http://localhost:3000) to access your Sourcebot instance. + + + +## Next steps + + diff --git a/docs/docs/deployment/k8s.mdx b/docs/docs/deployment/k8s.mdx new file mode 100644 index 00000000..e943c022 --- /dev/null +++ b/docs/docs/deployment/k8s.mdx @@ -0,0 +1,4 @@ +--- +title: "Kubernetes (Helm)" +url: https://github.com/sourcebot-dev/sourcebot-helm-chart +--- \ No newline at end of file diff --git a/docs/docs/features/agents/review-agent.mdx b/docs/docs/features/agents/review-agent.mdx index 49e1834d..41416f75 100644 --- a/docs/docs/features/agents/review-agent.mdx +++ b/docs/docs/features/agents/review-agent.mdx @@ -10,7 +10,7 @@ codebase that the agent may fetch to perform the review. This agent provides codebase-aware reviews for your PRs. For each diff, this agent fetches relevant context from Sourcebot and feeds it into an LLM for a detailed review of your changes. -The AI Code Review Agent is [fair source](https://github.com/sourcebot-dev/sourcebot/tree/main/packages/web/src/features/agents/review-agent) and packaged in [Sourcebot](https://github.com/sourcebot-dev/sourcebot). To get started using this agent, [deploy Sourcebot](/docs/deployment-guide) +The AI Code Review Agent is [fair source](https://github.com/sourcebot-dev/sourcebot/tree/main/packages/web/src/features/agents/review-agent) and packaged in [Sourcebot](https://github.com/sourcebot-dev/sourcebot). To get started using this agent, [deploy Sourcebot](/docs/deployment/docker-compose) and then follow the configuration instructions below. ![AI Code Review Agent Example](/images/review_agent_example.png) diff --git a/docs/docs/features/ask/overview.mdx b/docs/docs/features/ask/overview.mdx index cd48b8c9..9e877089 100644 --- a/docs/docs/features/ask/overview.mdx +++ b/docs/docs/features/ask/overview.mdx @@ -14,7 +14,7 @@ follow code nav references, and provide an answer that’s rich with inline cita Learn how to index your repos so you can ask questions about them - + Learn how to self-host Sourcebot in a few simple steps. diff --git a/docs/docs/features/mcp-server.mdx b/docs/docs/features/mcp-server.mdx index adfb98ce..97351296 100644 --- a/docs/docs/features/mcp-server.mdx +++ b/docs/docs/features/mcp-server.mdx @@ -9,7 +9,7 @@ The [Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP) - Follow the [deployment guide](/docs/deployment-guide) to launch Sourcebot and get your code indexed. The host url of your instance (e.g., `http://localhost:3000`) is passed to the MCP server via the `SOURCEBOT_HOST` url. + Follow the [deployment guides](/docs/deployment/docker-compose) to launch Sourcebot and get your code indexed. The host url of your instance (e.g., `http://localhost:3000`) is passed to the MCP server via the `SOURCEBOT_HOST` url. If a host is not provided, then the server will fallback to using the demo instance hosted at https://demo.sourcebot.dev. You can see the list of repositories indexed [here](https://demo.sourcebot.dev/~/repos). Add additional repositories by [opening a PR](https://github.com/sourcebot-dev/sourcebot/blob/main/demo-site-config.json). diff --git a/docs/docs/features/search/overview.mdx b/docs/docs/features/search/overview.mdx index 5f703a3c..f5372ba4 100644 --- a/docs/docs/features/search/overview.mdx +++ b/docs/docs/features/search/overview.mdx @@ -22,7 +22,7 @@ Search across all your repos/branches across any code host platform. Blazingly f Learn how to index and search through your branches - + Learn how to self-host Sourcebot in a few simple steps. diff --git a/docs/docs/overview.mdx b/docs/docs/overview.mdx index 15a42dcb..3b2b96ff 100644 --- a/docs/docs/overview.mdx +++ b/docs/docs/overview.mdx @@ -9,7 +9,7 @@ title: "Overview" - [MCP](/docs/features/mcp-server): Enrich agent context windows with code across your organization - + Learn how to self-host Sourcebot in a few simple steps. @@ -162,7 +162,7 @@ Sourcebot is designed to be easily self-hosted, allowing you to deploy it onto y --- - +