-
Notifications
You must be signed in to change notification settings - Fork 187
feat(deployment): Basic docker-compose file #480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| services: | ||
| sourcebot: | ||
| image: ghcr.io/sourcebot-dev/sourcebot:latest | ||
| user: sourcebot | ||
| restart: always | ||
| container_name: sourcebot | ||
| depends_on: | ||
| postgres: | ||
| condition: service_healthy | ||
| redis: | ||
| condition: service_healthy | ||
| ports: | ||
| - "3000:3000" | ||
| volumes: | ||
| - ./config.json:/data/config.json | ||
| - sourcebot_data:/data | ||
brendan-kellam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| environment: | ||
| - CONFIG_PATH=/data/config.json | ||
| - AUTH_URL=${AUTH_URL:-http://localhost:3000} | ||
| - AUTH_SECRET=${AUTH_SECRET:-000000000000000000000000000000000} # CHANGEME: generate via `openssl rand -base64 33` | ||
| - SOURCEBOT_ENCRYPTION_KEY=${SOURCEBOT_ENCRYPTION_KEY:-000000000000000000000000000000000} # CHANGEME: generate via `openssl rand -base64 24` | ||
| - DATABASE_URL=${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/postgres} # CHANGEME | ||
| - REDIS_URL=${REDIS_URL:-redis://redis:6379} # CHANGEME | ||
| - SOURCEBOT_EE_LICENSE_KEY=${SOURCEBOT_EE_LICENSE_KEY:-} | ||
| - SOURCEBOT_TELEMETRY_DISABLED=${SOURCEBOT_TELEMETRY_DISABLED:-false} | ||
|
|
||
| # For the full list of environment variables see: | ||
| # https://docs.sourcebot.dev/docs/configuration/environment-variables | ||
|
|
||
| postgres: | ||
| image: docker.io/postgres:${POSTGRES_VERSION:-latest} | ||
| restart: always | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
| interval: 3s | ||
| timeout: 3s | ||
| retries: 10 | ||
| environment: | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: postgres # CHANGEME | ||
| POSTGRES_DB: postgres | ||
| ports: | ||
| - 127.0.0.1:5432:5432 | ||
| volumes: | ||
| - sourcebot_postgres_data:/var/lib/postgresql/data | ||
|
|
||
| redis: | ||
| image: docker.io/redis:${REDIS_VERSION:-latest} | ||
| restart: always | ||
| ports: | ||
| - 127.0.0.1:6379:6379 | ||
| healthcheck: | ||
| test: ["CMD", "redis-cli", "ping"] | ||
| interval: 3s | ||
| timeout: 10s | ||
| retries: 10 | ||
| volumes: | ||
| - sourcebot_redis_data:/data | ||
|
|
||
| volumes: | ||
| sourcebot_data: | ||
| driver: local | ||
| sourcebot_postgres_data: | ||
| driver: local | ||
| sourcebot_redis_data: | ||
| driver: local | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
|
|
||
| <Steps> | ||
| <Step title="Requirements"> | ||
| - docker & docker compose. Use [Docker Desktop](https://www.docker.com/products/docker-desktop/) on Mac or Windows. | ||
| </Step> | ||
| <Step title="Obtain the Docker Compose file"> | ||
| 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 | ||
| ``` | ||
| </Step> | ||
|
|
||
| <Step title="Create a config.json"> | ||
|
|
||
| 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 | ||
| ``` | ||
| </Step> | ||
|
|
||
| <Step title="Launch your instance"> | ||
| Update the secrets in the `docker-compose.yml` and then run Sourcebot using: | ||
|
|
||
| ```bash wrap icon="terminal" | ||
| docker compose up | ||
| ``` | ||
| </Step> | ||
|
|
||
| <Step title="Done"> | ||
| You're all set! Navigate to [http://localhost:3000](http://localhost:3000) to access your Sourcebot instance. | ||
| </Step> | ||
| </Steps> | ||
|
|
||
| ## Next steps | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| title: "Kubernetes (Helm)" | ||
| url: https://github.com/sourcebot-dev/sourcebot-helm-chart | ||
| --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.