Files
deploy-sourcegraph-docker/docker-compose
Stephen Gutekanst f9a5faa364 docker-compose: do not quote env var values (#131)
The double quotes meant this Caddy configuration:

```
reverse_proxy {$SRC_FRONTEND_ADDRESSES}
```

Expanded to:

```
reverse_proxy "sourcegraph-frontend-0:3080 sourcegraph-frontend-1:3080 sourcegraph-frontend-2:3080"
```

Instead of:

```
reverse_proxy sourcegraph-frontend-0:3080 sourcegraph-frontend-1:3080 sourcegraph-frontend-2:3080
```

Which led to Sourcegraph being unavailable entirely:

```
2020/08/14 00:03:05.971	INFO	using provided configuration	{"config_file": "/etc/caddy/Caddyfile", "config_adapter": "caddyfile"}
run: adapting config using caddyfile: parsing caddyfile tokens for 'reverse_proxy': /etc/caddy/Caddyfile:7 - Error during parsing: parsing upstream address: parse "undefined://sourcegraph-frontend-0:3080 sourcegraph-frontend-1:3080 sourcegraph-frontend-2:3080": invalid character " " in host name
```

This came from
2020-08-13 18:54:08 -07:00
..
2020-07-20 17:12:22 -07:00

Sourcegraph for docker-compose

This folder contains a Sourcegraph docker-compose deployment.

Deploying

Simply clone the repository and docker-compose up -d to deploy Sourcegraph:

git clone https://github.com/sourcegraph/deploy-sourcegraph-docker
cd deploy-sourcegraph-docker/docker-compose/
git checkout v3.18.0
docker-compose up -d

Sourcegraph will then run in the background and across server restarts.

Notes:

  • The docker-compose.yaml file currently depends on configuration files which live in the repository, as such you must have the repository cloned onto your server.
  • Data for all services will be stored as docker volumes.
  • Use docker ps to inspect the Sourcegraph containers, and docker-compose down to teardown the deployment.

Upgrading

Always refer to https://docs.sourcegraph.com/admin/updates/docker_compose prior to upgrading, as it will document any manual steps you may need to take in order to upgrade smoothly.