|
1 | | -# Pure-Docker Sourcegraph cluster deployment reference |
| 1 | +# Sourcegraph with Docker Compose |
2 | 2 |
|
3 | | -[](https://sourcegraph.com/github.com/sourcegraph/deploy-sourcegraph-docker) |
| 3 | +[](https://sourcegraph.com/github.com/sourcegraph/deploy-sourcegraph-docker) [](https://buildkite.com/sourcegraph/deploy-sourcegraph-docker) |
4 | 4 |
|
5 | | -There are two recommended ways to deploy Sourcegraph: |
| 5 | +This repository is the deployment reference for [deploying Sourcegraph with Docker Compose](https://docs.sourcegraph.com/admin/install/docker-compose). |
6 | 6 |
|
7 | | -- [Single-machine Docker deployment](https://docs.sourcegraph.com/admin/install/docker) |
8 | | -- [Multi-machine Kubernetes deployment](https://docs.sourcegraph.com/admin/install/kubernetes_cluster) |
| 7 | +> 🚨 IMPORTANT: When upgrading Sourcegraph, please check [upgrading docs](https://docs.sourcegraph.com/admin/updates/docker_compose) to check if any manual migrations are necessary. |
| 8 | +> |
| 9 | +> The `master` branch tracks development. Use the branch of this repository corresponding to the |
| 10 | +> version of Sourcegraph you wish to deploy, e.g. `git checkout 3.19`. |
9 | 11 |
|
10 | | -But what if your organization wants a multi-machine deployment without using Kubernetes? What if you use a different container management platform, for example? This project aims to solve that, by providing a pure-Docker deployment option. |
| 12 | +For product and [pricing](https://about.sourcegraph.com/pricing/) information, visit |
| 13 | +[about.sourcegraph.com](https://about.sourcegraph.com) or [contact |
| 14 | +us](https://about.sourcegraph.com/contact/sales) for more information. If you're just starting out, |
| 15 | +we recommend running Sourcegraph as a [single Docker |
| 16 | +container](https://docs.sourcegraph.com/#quickstart-guide) or using [Docker |
| 17 | +Compose](https://docs.sourcegraph.com/admin/install/docker-compose). Migrating to Sourcegraph on |
| 18 | +Kubernetes is easy later. |
11 | 19 |
|
12 | | -The goal is that anyone using a container management platform other than Kubernetes (Netflix's [Titus](https://netflix.github.io/titus/), Apache's [Mesos](http://mesos.apache.org/documentation/latest/docker-containerizer/), etc.) would be able to use this repository as a reference for how to deploy Sourcegraph. |
| 20 | +## Is Docker Compose the right deployment type for me? |
13 | 21 |
|
14 | | -## Deploying |
| 22 | +Please see [our docs](https://docs.sourcegraph.com/admin/install) for comparisons of deployment types and our resource estimator. |
15 | 23 |
|
16 | | -First clone the repository, then: |
| 24 | +## Contributing |
17 | 25 |
|
18 | | -```bash |
19 | | -./deploy.sh |
20 | | -``` |
| 26 | +We've made our deployment configurations open source to better serve our customers' needs. If there is anything we can do to make deploying Sourcegraph easier just [open an issue (in sourcegraph/sourcegraph)](https://github.com/sourcegraph/sourcegraph/issues/new?assignees=&labels=deploy-sourcegraph-docker&title=%5Bdeploy-sourcegraph-docker%5D) or a pull request and we will respond promptly! |
21 | 27 |
|
22 | | -Visit http://localhost:3080 to visit the running Sourcegraph instance! |
23 | | - |
24 | | -## Tearing down the deployment |
25 | | - |
26 | | -```bash |
27 | | -./teardown.sh |
28 | | -``` |
29 | | - |
30 | | -## System topology |
31 | | - |
32 | | -To understand the system topology: |
33 | | - |
34 | | -1. Look at `deploy.sh` to get an overview of services. |
35 | | -2. Every service (`deploy-*.sh`) has documentation inline indicating: |
36 | | - - What the service does / provides. |
37 | | - - What ports the service exposes. |
38 | | - - What other services it talks to (see environment variables). |
39 | | - |
40 | | -## Service system requirements |
41 | | - |
42 | | -Every service (`deploy-*.sh`) documents inline what the system requirements are (CPU/Memory/Disk allocation). For example, [the frontend service](https://github.com/sourcegraph/deploy-sourcegraph-docker/blob/f01b97a397138dd76e5f5ed45b2574b9a2e70cd1/deploy-frontend.sh#L6-L9). |
43 | | - |
44 | | -## Scaling / replicas |
45 | | - |
46 | | -To scale the cluster deployment, you will need to: |
47 | | - |
48 | | -1. Deploy more instances of `gitserver`, `indexed-search`, `searcher` and `symbols` services as desired. |
49 | | -2. [Configure the `frontend` and `frontend-internal` to communicate with the new instances.](https://github.com/sourcegraph/deploy-sourcegraph-docker/blob/f01b97a397138dd76e5f5ed45b2574b9a2e70cd1/deploy-frontend.sh#L31-L34) |
50 | | -3. You're done! You do not need to configure or restart any other services. |
51 | | - |
52 | | -## Metrics and Tracing |
53 | | - |
54 | | -This deployment comes with metrics and tracing built-in. See [metrics and tracing](metrics-and-tracing.md) for details. |
55 | | - |
56 | | -## Configuring HTTPS |
57 | | - |
58 | | -See https://docs.sourcegraph.com/admin/nginx#nginx-for-other-sourcegraph-clusters-e-g-pure-docker |
59 | | - |
60 | | -## Configuring SSH cloning |
61 | | - |
62 | | -1. Ensure your **Site admin** > **External services** code host configuration is configured to use SSH. For example, by setting the [`gitURLType`](https://docs.sourcegraph.com/admin/site_config/all#giturltype-string-enum) field to `"ssh"`. You may still need to configure an access token or other codehost authentication method in order for Sourcegraph to discover your repositories. |
63 | | - |
64 | | -Alternatively, you may use the `OTHER` codehost type under **External services**, which allows you to directly specify Git repository URLs for cloning. |
65 | | - |
66 | | -2. Provide your `gitserver` instances with your SSH / Git configuration (usually just `.ssh/id_rsa`, `.ssh/id_rsa.pub`, and `.ssh/known_hosts` -- but you can also provide other files like `.netrc`, `.gitconfig`, etc. if needed) by mounting it into the `sourcegraph` users home directory in the `gitserver` containers. For example, by adding the following flag: |
67 | | - |
68 | | -``` |
69 | | --v ~/my-sourcegraph-ssh-config/.ssh:/home/sourcegraph/.ssh |
70 | | -``` |
71 | | - |
72 | | -All future Git cloning operations will use the credentials configured there. |
73 | | - |
74 | | -If you wish, you can test that cloning with your configuration is working by performing the clone in a gitserver container shell, e.g. first acquire shell access: |
75 | | - |
76 | | -``` |
77 | | -$ docker exec -it gitserver-0 sh |
78 | | -``` |
| 28 | +## Questions & Issues |
79 | 29 |
|
80 | | -Then try cloning the repository: |
| 30 | +[Open an issue (in sourcegraph/sourcegraph)](https://github.com/sourcegraph/sourcegraph/issues/new?assignees=&labels=deploy-sourcegraph&template=deploy-sourcegraph.md&title=%5Bdeploy-sourcegraph%5D) or contact us (support@sourcegraph.com), we are happy to help! |
81 | 31 |
|
82 | | -``` |
83 | | -$ git clone ssh://git@myhost.com/my/repo /tmp/my-repo |
84 | | -``` |
85 | | -## Questions & Issues |
| 32 | +## Pure-Docker Sourcegraph cluster deployment reference |
86 | 33 |
|
87 | | -[Open an issue (in sourcegraph/sourcegraph)](https://github.com/sourcegraph/sourcegraph/issues/new?assignees=&labels=deploy-sourcegraph-docker&template=deploy-sourcegraph-docker.md&title=%5Bdeploy-sourcegraph-docker%5D) or contact us (support@sourcegraph.com), we are happy to help! |
| 34 | +What if your organization wants a multi-machine deployment without using Kubernetes? |
| 35 | +What if you use a different container management platform, for example? |
| 36 | +Anyone using a container management platform other than Kubernetes (Netflix's [Titus](https://netflix.github.io/titus/), Apache's [Mesos](http://mesos.apache.org/documentation/latest/docker-containerizer/), etc.) can use our [Pure-Docker Sourcegraph cluster deployment reference](./pure-docker/README.md) to deploy Sourcegraph. |
0 commit comments