Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@
This directory contains the Sourcegraph with Docker Compose deployment reference.

To learn more about deploying, configuring, and upgrading a Sourcegraph with Docker Compose installation, please refer to our documentation: [Sourcegraph with Docker Compose](https://docs.sourcegraph.com/admin/install/docker-compose)

## Shared object storage

Sourcegraph requires an object storage to work. [Learn more](https://sourcegraph.com/docs/self-hosted/external-services/object-storage#sourcegraph-bucket).

[`sourcegraph-uploads.env`](sourcegraph-uploads.env) configures shared Sourcegraph object storage for six services: frontend, worker, precise code intel, syntactic code intel, gitserver, and searcher. It uses a bundled blobstore by default to get you started, but we strongly recommend using S3 or GCS.

To use an external S3 or GCS bucket, update that file with the correct settings.

For GCS, embedding the service-account JSON with `SOURCEGRAPH_UPLOAD_GOOGLE_APPLICATION_CREDENTIALS_FILE_CONTENT` avoids requiring an identical credential-file mount in every container. If `SOURCEGRAPH_UPLOAD_GOOGLE_APPLICATION_CREDENTIALS_FILE` is used instead, mount that path into every consumer.
7 changes: 7 additions & 0 deletions docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ services:
image: 'index.docker.io/sourcegraph/frontend:6.1.2889@sha256:43dad562a65d08842659abdd06cf3c92d3745cc9e18c3762e458b78028a86e1e'
cpus: 4
mem_limit: '8g'
env_file: sourcegraph-uploads.env
environment:
- DEPLOY_TYPE=docker-compose
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
Expand Down Expand Up @@ -180,6 +181,7 @@ services:
image: 'index.docker.io/sourcegraph/frontend:6.1.2889@sha256:43dad562a65d08842659abdd06cf3c92d3745cc9e18c3762e458b78028a86e1e'
cpus: 4
mem_limit: '8g'
env_file: sourcegraph-uploads.env
environment:
- DEPLOY_TYPE=docker-compose
- PGHOST=pgsql
Expand Down Expand Up @@ -226,6 +228,7 @@ services:
image: 'index.docker.io/sourcegraph/gitserver:6.1.2889@sha256:282142b7886f58b0ea7251575c92d5c837ff8649d5831c9c52745ebed6f3af4f'
cpus: 4
mem_limit: '8g'
env_file: sourcegraph-uploads.env
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
Expand Down Expand Up @@ -299,6 +302,7 @@ services:
image: 'index.docker.io/sourcegraph/searcher:6.1.2889@sha256:66f633e4e666d65684915087009bdbdb8a46dad6eccb4c307a6de141e0225be6'
cpus: 2
mem_limit: '2g'
env_file: sourcegraph-uploads.env
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
Expand All @@ -323,6 +327,7 @@ services:
image: 'index.docker.io/sourcegraph/precise-code-intel-worker:6.1.2889@sha256:2a8ec49e080ff19e6f05f92c39cfc67ac50b8e2ff5aba4dcbd7451bba1e8d539'
cpus: 2
mem_limit: '4g'
env_file: sourcegraph-uploads.env
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- 'PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore'
Expand All @@ -349,6 +354,7 @@ services:
image: 'index.docker.io/sourcegraph/worker:6.1.2889@sha256:1ef615670e315edda8511ab1e06ffd27b98129bc962bf06aca455c7731baf482'
cpus: 4
mem_limit: '4g'
env_file: sourcegraph-uploads.env
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
Expand All @@ -374,6 +380,7 @@ services:
image: 'index.docker.io/sourcegraph/syntactic-code-intel-worker:6.1.1295@sha256:c6e2b097b8f16394e339588e208c43587f1fa6a35cb44e9759622c448ddc1445'
cpus: 2
mem_limit: '4g'
env_file: sourcegraph-uploads.env
environment:
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
- 'PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore'
Expand Down
6 changes: 6 additions & 0 deletions docker-compose/sourcegraph-uploads.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Shared Sourcegraph object storage. These values use the bundled blobstore.
SOURCEGRAPH_UPLOAD_BACKEND=blobstore
SOURCEGRAPH_UPLOAD_AWS_ENDPOINT=http://blobstore:9000

# To use external S3 or GCS, replace the settings above and provide every
# container with credentials here. See README.md for supported settings.
Loading