mirror of
https://github.com/RustyRaptor/deploy-sourcegraph-docker.git
synced 2026-12-04 08:15:24 -07:00
* all: replace minio with sourcegraph/blobstore * all: bump image tags for blobstore change * pure-docker: update image tags (manually) Signed-off-by: Stephen Gutekanst <stephen@sourcegraph.com>
799 lines
28 KiB
YAML
799 lines
28 KiB
YAML
version: '2.4'
|
|
services:
|
|
# Description: This container will migrate the Postgres `frontend`,
|
|
# `codeintel`, and `codeinsights` databases
|
|
#
|
|
# Disk: None
|
|
# Ports: None
|
|
#
|
|
# This container should start after the database instance starts, perform the migrations
|
|
# and then exit cleanly. After exiting the `frontend` service is allowed to start.
|
|
#
|
|
# If you're using a DB instance hosted outside of docker-compose, the environment variables
|
|
# for this container will need to be updated to reflect the new connection information.
|
|
migrator:
|
|
container_name: migrator
|
|
image: 'index.docker.io/sourcegraph/migrator:187572_2022-12-06_cbecc5321c7d@sha256:93fc175df594738a98a62f2057271824cdb674b0e63bedac9dc7cb0f04db76bb'
|
|
cpus: 0.5
|
|
mem_limit: '500m'
|
|
command: ['up']
|
|
environment:
|
|
- PGHOST=pgsql
|
|
- PGPORT=5432
|
|
- PGUSER=sg
|
|
- PGPASSWORD=sg
|
|
- PGDATABASE=sg
|
|
- PGSSLMODE=disable
|
|
|
|
- CODEINTEL_PGHOST=codeintel-db
|
|
- CODEINTEL_PGPORT=5432
|
|
- CODEINTEL_PGUSER=sg
|
|
- CODEINTEL_PGPASSWORD=sg
|
|
- CODEINTEL_PGDATABASE=sg
|
|
- CODEINTEL_PGSSLMODE=disable
|
|
|
|
# If you are not running code insights, please see:
|
|
# https://docs.sourcegraph.com/admin/install/docker-compose/operations#database-migrations for more information
|
|
# for information on how to configure Sourcegraph migrations
|
|
- CODEINSIGHTS_PGHOST=codeinsights-db
|
|
- CODEINSIGHTS_PGPORT=5432
|
|
- CODEINSIGHTS_PGUSER=postgres
|
|
- CODEINSIGHTS_PGPASSWORD=password
|
|
- CODEINSIGHTS_PGDATABASE=postgres
|
|
- CODEINSIGHTS_PGSSLMODE=disable
|
|
restart: 'on-failure'
|
|
networks:
|
|
- sourcegraph
|
|
depends_on:
|
|
pgsql:
|
|
condition: service_healthy
|
|
codeinsights-db:
|
|
condition: service_healthy
|
|
codeintel-db:
|
|
condition: service_healthy
|
|
|
|
# Description: Acts as a reverse proxy for all of the sourcegraph-frontend instances
|
|
#
|
|
# Disk: 1GB / persistent SSD
|
|
# Ports exposed to other Sourcegraph services: none
|
|
# Ports exposed to the public internet: 80 (HTTP) and 443 (HTTPS)
|
|
#
|
|
# Sourcegraph ships with a few builtin templates that cover common HTTP/HTTPS configurations:
|
|
# - HTTP only (default)
|
|
# - HTTPS with Let's Encrypt
|
|
# - HTTPS with custom certificates
|
|
#
|
|
# Follow the directions in the comments below to swap between these configurations.
|
|
#
|
|
# If none of these built-in configurations suit your needs, then you can create your own Caddyfile, see:
|
|
# https://caddyserver.com/docs/caddyfile
|
|
caddy:
|
|
container_name: caddy
|
|
image: 'index.docker.io/caddy:2.5.1-alpine@sha256:6e62b63d4d7a4826f9e93c904a0e5b886a8bea2234b6569e300924282a2e8e6c'
|
|
cpus: 4
|
|
mem_limit: '4g'
|
|
environment:
|
|
- 'XDG_DATA_HOME=/caddy-storage/data'
|
|
- 'XDG_CONFIG_HOME=/caddy-storage/config'
|
|
- 'SRC_FRONTEND_ADDRESSES=sourcegraph-frontend-0:3080'
|
|
# Uncomment & update this line when using Let's Encrypt or custom HTTPS certificates:
|
|
# - 'SRC_SITE_ADDRESS=sourcegraph.example.com'
|
|
#
|
|
# Uncomment & update the following line when using HTTPS with Let's Encrypt
|
|
# - 'SRC_ACME_EMAIL=admin@example.com'
|
|
volumes:
|
|
- 'caddy:/caddy-storage'
|
|
#
|
|
# IMPORTANT: if a customer uses a reverse proxy in front of Caddy
|
|
# the configuration files below must be updated to include trusted_proxies
|
|
#
|
|
# Comment out the following line when using HTTPS with either Let's Encrypt or custom certificates
|
|
- '../caddy/builtins/http.Caddyfile:/etc/caddy/Caddyfile'
|
|
#
|
|
# Uncomment the following line when using HTTPS with Let's Encrypt's staging environment
|
|
# - '../caddy/builtins/https.lets-encrypt-staging.Caddyfile:/etc/caddy/Caddyfile'
|
|
#
|
|
# Uncomment the following line when using HTTPS with Let's Encrypt's production environment
|
|
# IMPORTANT: Strongly recommended to test with the staging configuration above first, see that file for details.
|
|
# - '../caddy/builtins/https.lets-encrypt-prod.Caddyfile:/etc/caddy/Caddyfile'
|
|
#
|
|
# Uncomment the following line when using HTTPS with custom certificates
|
|
# - '../caddy/builtins/https.custom-cert.Caddyfile:/etc/caddy/Caddyfile'
|
|
#
|
|
# Uncomment / update the following line when using HTTPS with custom certificates
|
|
# - '/LOCAL/CERT/PATH.pem:/sourcegraph.pem'
|
|
#
|
|
# Uncomment / update the following line when using HTTPS with custom certificates
|
|
# - '/LOCAL/KEY/PATH.key:/sourcegraph.key'
|
|
ports:
|
|
- '0.0.0.0:80:80'
|
|
- '0.0.0.0:443:443'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
|
|
# Description: Serves the frontend of Sourcegraph via HTTP(S).
|
|
#
|
|
# Disk: 128GB / non-persistent SSD
|
|
# Ports exposed to other Sourcegraph services: 6060/TCP, 3080 (HTTP), and/or 3443 (HTTPS)
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
# Note: SRC_GIT_SERVERS, SEARCHER_URL, and SYMBOLS_URL are space-separated
|
|
# lists which each allow you to specify more container instances for scaling
|
|
# purposes. Be sure to also apply such a change here to the frontend-internal
|
|
# service.
|
|
sourcegraph-frontend-0:
|
|
container_name: sourcegraph-frontend-0
|
|
image: 'index.docker.io/sourcegraph/frontend:187572_2022-12-06_cbecc5321c7d@sha256:73e64a8636e70ebbaf7f4a3300479529294f67e8cf644cdaea02435915aec869'
|
|
cpus: 4
|
|
mem_limit: '8g'
|
|
environment:
|
|
- DEPLOY_TYPE=docker-compose
|
|
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
|
|
- PGHOST=pgsql
|
|
- CODEINTEL_PGHOST=codeintel-db
|
|
- CODEINSIGHTS_PGDATASOURCE=postgres://postgres:password@codeinsights-db:5432/postgres
|
|
- 'SRC_GIT_SERVERS=gitserver-0:3178'
|
|
- 'SRC_SYNTECT_SERVER=http://syntect-server:9238'
|
|
- 'SEARCHER_URL=http://searcher-0:3181'
|
|
- 'SYMBOLS_URL=http://symbols-0:3184'
|
|
- 'INDEXED_SEARCH_SERVERS=zoekt-webserver-0:6070'
|
|
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
|
|
- 'REPO_UPDATER_URL=http://repo-updater:3182'
|
|
- 'GRAFANA_SERVER_URL=http://grafana:3370'
|
|
- 'GITHUB_BASE_URL=http://github-proxy:3180'
|
|
- 'PROMETHEUS_URL=http://prometheus:9090'
|
|
- 'PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore'
|
|
- 'PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000'
|
|
healthcheck:
|
|
test: "wget -q 'http://127.0.0.1:3080/healthz' -O /dev/null || exit 1"
|
|
interval: 10s
|
|
timeout: 10s
|
|
retries: 10
|
|
start_period: 300s
|
|
volumes:
|
|
- 'sourcegraph-frontend-0:/mnt/cache'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
depends_on:
|
|
sourcegraph-frontend-internal:
|
|
condition: service_healthy
|
|
|
|
# Description: Serves the internal Sourcegraph frontend API.
|
|
#
|
|
# Disk: 128GB / non-persistent SSD
|
|
# Ports exposed to other Sourcegraph services: 3090/TCP 6060/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
sourcegraph-frontend-internal:
|
|
container_name: sourcegraph-frontend-internal
|
|
image: 'index.docker.io/sourcegraph/frontend:187572_2022-12-06_cbecc5321c7d@sha256:73e64a8636e70ebbaf7f4a3300479529294f67e8cf644cdaea02435915aec869'
|
|
cpus: 4
|
|
mem_limit: '8g'
|
|
environment:
|
|
- DEPLOY_TYPE=docker-compose
|
|
- PGHOST=pgsql
|
|
- CODEINTEL_PGHOST=codeintel-db
|
|
- CODEINSIGHTS_PGDATASOURCE=postgres://postgres:password@codeinsights-db:5432/postgres
|
|
- 'SRC_GIT_SERVERS=gitserver-0:3178'
|
|
- 'SRC_SYNTECT_SERVER=http://syntect-server:9238'
|
|
- 'SEARCHER_URL=http://searcher-0:3181'
|
|
- 'SYMBOLS_URL=http://symbols-0:3184'
|
|
- 'INDEXED_SEARCH_SERVERS=zoekt-webserver-0:6070'
|
|
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
|
|
- 'REPO_UPDATER_URL=http://repo-updater:3182'
|
|
- 'GRAFANA_SERVER_URL=http://grafana:3000'
|
|
- 'GITHUB_BASE_URL=http://github-proxy:3180'
|
|
- 'PROMETHEUS_URL=http://prometheus:9090'
|
|
- 'PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore'
|
|
- 'PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000'
|
|
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
|
|
volumes:
|
|
- 'sourcegraph-frontend-internal-0:/mnt/cache'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
healthcheck:
|
|
test: "wget -q 'http://127.0.0.1:3080/healthz' -O /dev/null || exit 1"
|
|
interval: 5s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 300s
|
|
depends_on:
|
|
pgsql:
|
|
condition: service_healthy
|
|
codeintel-db:
|
|
condition: service_healthy
|
|
migrator:
|
|
condition: service_completed_successfully
|
|
|
|
# Description: Stores clones of repositories to perform Git operations.
|
|
#
|
|
# Disk: 200GB / persistent SSD
|
|
# Ports exposed to other Sourcegraph services: 3178/TCP 6060/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
gitserver-0:
|
|
container_name: gitserver-0
|
|
image: 'index.docker.io/sourcegraph/gitserver:187572_2022-12-06_cbecc5321c7d@sha256:87642b2f0cccbdcd661e470c8f7aa6c022ab03065a2c8ab565afc4b8829a4531'
|
|
cpus: 4
|
|
mem_limit: '8g'
|
|
environment:
|
|
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
|
|
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
|
|
- 'GITHUB_BASE_URL=http://github-proxy:3180'
|
|
volumes:
|
|
- 'gitserver-0:/data/repos'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
hostname: gitserver-0
|
|
|
|
# Description: Backend for indexed text search operations.
|
|
#
|
|
# Disk: 200GB / persistent SSD
|
|
# Network: 100mbps
|
|
# Liveness probe: n/a
|
|
# Ports exposed to other Sourcegraph services: 6072/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
zoekt-indexserver-0:
|
|
container_name: zoekt-indexserver-0
|
|
image: 'index.docker.io/sourcegraph/search-indexer:187572_2022-12-06_cbecc5321c7d@sha256:a3ae20e4130b4846e2c3078b9ba942854890348da37c8fa7ee385c081b7d1666'
|
|
cpus: 8
|
|
mem_limit: '16g'
|
|
environment:
|
|
- 'HOSTNAME=zoekt-webserver-0:6070'
|
|
- 'SRC_FRONTEND_INTERNAL=http://sourcegraph-frontend-internal:3090'
|
|
- 'OPENTELEMETRY_DISABLED=false'
|
|
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
|
|
volumes:
|
|
- 'zoekt-0-shared:/data/index'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
hostname: zoekt-indexserver-0
|
|
|
|
# Description: Backend for indexed text search operations.
|
|
#
|
|
# Disk: 200GB / persistent SSD
|
|
# Ports exposed to other Sourcegraph services: 6070/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
zoekt-webserver-0:
|
|
container_name: zoekt-webserver-0
|
|
image: 'index.docker.io/sourcegraph/indexed-searcher:187572_2022-12-06_cbecc5321c7d@sha256:79bec59c17482e4039931ed083113bd8723d74c42b96c3c489062f6b33b806f0'
|
|
cpus: 8
|
|
mem_limit: '50g'
|
|
environment:
|
|
- 'HOSTNAME=zoekt-webserver-0:6070'
|
|
- 'OPENTELEMETRY_DISABLED=false'
|
|
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
|
|
healthcheck:
|
|
test: "wget -q 'http://127.0.0.1:6070/healthz' -O /dev/null || exit 1"
|
|
interval: 5s
|
|
timeout: 10s
|
|
retries: 3
|
|
volumes:
|
|
- 'zoekt-0-shared:/data/index'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
hostname: zoekt-webserver-0
|
|
|
|
# Description: Backend for text search operations.
|
|
#
|
|
# Disk: 128GB / non-persistent SSD
|
|
# Ports exposed to other Sourcegraph services: 3181/TCP 6060/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
searcher-0:
|
|
container_name: searcher-0
|
|
image: 'index.docker.io/sourcegraph/searcher:187572_2022-12-06_cbecc5321c7d@sha256:c0d7b580c31e956dc586e3947edd2afb850cf5954e83010236294c57478256da'
|
|
cpus: 2
|
|
mem_limit: '2g'
|
|
environment:
|
|
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
|
|
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
|
|
healthcheck:
|
|
test: "wget -q 'http://127.0.0.1:3181/healthz' -O /dev/null || exit 1"
|
|
interval: 5s
|
|
timeout: 10s
|
|
retries: 3
|
|
volumes:
|
|
- 'searcher-0:/mnt/cache'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
|
|
# Description: Rate-limiting proxy for the GitHub API.
|
|
#
|
|
# CPU: 1
|
|
# Memory: 1GB
|
|
# Disk: 1GB / non-persistent SSD (only for read-only config file)
|
|
# Ports exposed to other Sourcegraph services: 3180/TCP 6060/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
github-proxy:
|
|
container_name: github-proxy
|
|
image: 'index.docker.io/sourcegraph/github-proxy:187572_2022-12-06_cbecc5321c7d@sha256:b4739adfced18f2a8883da931da681f444b489f6606052246f7c8d536f22e425'
|
|
cpus: 1
|
|
mem_limit: '1g'
|
|
environment:
|
|
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
|
|
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
|
|
# Description: Handles conversion of uploaded precise code intelligence bundles.
|
|
#
|
|
# Ports exposed to other Sourcegraph services: 3188/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
precise-code-intel-worker:
|
|
container_name: precise-code-intel-worker
|
|
image: 'index.docker.io/sourcegraph/precise-code-intel-worker:187572_2022-12-06_cbecc5321c7d@sha256:d1b1546d784fec8c90928a40e1b7eafc33202a53e4fcd501001d3f4a73e5c8ce'
|
|
cpus: 2
|
|
mem_limit: '4g'
|
|
environment:
|
|
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
|
|
- 'PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore'
|
|
- 'PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000'
|
|
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
|
|
healthcheck:
|
|
test: "wget -q 'http://127.0.0.1:3188/healthz' -O /dev/null || exit 1"
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 60s
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
|
|
# Description: Handles repository metadata (not Git data) lookups and updates from external code hosts and other similar services.
|
|
#
|
|
# Disk: 128GB / non-persistent SSD
|
|
# Ports exposed to other Sourcegraph services: 3182/TCP 6060/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
repo-updater:
|
|
container_name: repo-updater
|
|
image: 'index.docker.io/sourcegraph/repo-updater:187572_2022-12-06_cbecc5321c7d@sha256:0bf2b95c73bceff8c3edb96299175fe36a550f57fd3f5256d38fa2c42992655a'
|
|
cpus: 4
|
|
mem_limit: '4g'
|
|
environment:
|
|
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
|
|
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
|
|
- 'GITHUB_BASE_URL=http://github-proxy:3180'
|
|
volumes:
|
|
- 'repo-updater:/mnt/cache'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
|
|
# Description: Manages background processes.
|
|
#
|
|
# Disk: 128GB / non-persistent SSD
|
|
# Ports exposed to other Sourcegraph services: 3189/TCP 6060/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
worker:
|
|
container_name: worker
|
|
image: 'index.docker.io/sourcegraph/worker:187572_2022-12-06_cbecc5321c7d@sha256:0092211fee815b82d426ccf0a30999f8fb40749811e3a83c7570e576f028da74'
|
|
cpus: 4
|
|
mem_limit: '4g'
|
|
environment:
|
|
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
|
|
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
|
|
- 'SRC_GIT_SERVERS=gitserver-0:3178'
|
|
- 'SEARCHER_URL=http://searcher-0:3181'
|
|
- 'SYMBOLS_URL=http://symbols-0:3184'
|
|
- 'INDEXED_SEARCH_SERVERS=zoekt-webserver-0:6070'
|
|
- 'GITHUB_BASE_URL=http://github-proxy:3180'
|
|
- 'PRECISE_CODE_INTEL_UPLOAD_BACKEND=blobstore'
|
|
- 'PRECISE_CODE_INTEL_UPLOAD_AWS_ENDPOINT=http://blobstore:9000'
|
|
volumes:
|
|
- 'worker:/mnt/cache'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
|
|
# Description: Backend for syntax highlighting operations.
|
|
#
|
|
# Disk: none
|
|
# Ports exposed to other Sourcegraph services: 9238/TCP 6060/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
syntect-server:
|
|
container_name: syntect-server
|
|
image: 'index.docker.io/sourcegraph/syntax-highlighter:187572_2022-12-06_cbecc5321c7d@sha256:b88b20f56e942cc253109bb7f4b07746ebaecc2ff7393cdaf6415ffb8778fc45'
|
|
cpus: 4
|
|
mem_limit: '6g'
|
|
healthcheck:
|
|
test: "wget -q 'http://127.0.0.1:9238/health' -O /dev/null || exit 1"
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 5s
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
|
|
# Description: Backend for symbols operations.
|
|
#
|
|
# Disk: 128GB / non-persistent SSD
|
|
# Ports exposed to other Sourcegraph services: 3184/TCP 6060/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
symbols-0:
|
|
container_name: symbols-0
|
|
image: 'index.docker.io/sourcegraph/symbols:187572_2022-12-06_cbecc5321c7d@sha256:75615a60f318dc898eae2e5037efcd53e63cf28c2b8fca388b6923d215ff9db9'
|
|
cpus: 2
|
|
mem_limit: '4g'
|
|
environment:
|
|
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
|
|
- 'OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4317'
|
|
healthcheck:
|
|
test: "wget -q 'http://127.0.0.1:3184/healthz' -O /dev/null || exit 1"
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 60s
|
|
volumes:
|
|
- 'symbols-0:/mnt/cache'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
|
|
# Description: Prometheus collects metrics and aggregates them into graphs.
|
|
#
|
|
# Disk: 200GB / persistent SSD
|
|
# Ports exposed to other Sourcegraph services: none
|
|
# Ports exposed to the public internet: none (HTTP 9090 should be exposed to admins only)
|
|
#
|
|
prometheus:
|
|
container_name: prometheus
|
|
image: 'index.docker.io/sourcegraph/prometheus:187572_2022-12-06_cbecc5321c7d@sha256:2113ccab80409e995ee7ed9a3d386051f4ca73186375a3a0d7e3d55c90fa2007'
|
|
cpus: 4
|
|
mem_limit: '8g'
|
|
volumes:
|
|
- 'prometheus-v2:/prometheus'
|
|
- '../prometheus:/sg_prometheus_add_ons'
|
|
ports:
|
|
- '0.0.0.0:9090:9090'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
environment:
|
|
- 'SRC_FRONTEND_INTERNAL=sourcegraph-frontend-internal:3090'
|
|
|
|
# Description: Dashboards and graphs for Prometheus metrics.
|
|
#
|
|
# Disk: 2GB / persistent SSD
|
|
# Ports exposed to other Sourcegraph services: none
|
|
# Ports exposed to the public internet: none (HTTP 3370 should be exposed to admins only)
|
|
#
|
|
# Add the following environment variables if you wish to use an auth proxy with Grafana:
|
|
#
|
|
# 'GF_AUTH_PROXY_ENABLED=true'
|
|
# 'GF_AUTH_PROXY_HEADER_NAME='X-Forwarded-User'
|
|
# 'GF_SERVER_ROOT_URL='https://grafana.example.com'
|
|
grafana:
|
|
container_name: grafana
|
|
image: 'index.docker.io/sourcegraph/grafana:187572_2022-12-06_cbecc5321c7d@sha256:cf295a1dada50607a364390a54744dbc9142aa99b42c07f1bb623ca251639d2c'
|
|
cpus: 1
|
|
mem_limit: '1g'
|
|
volumes:
|
|
- 'grafana:/var/lib/grafana'
|
|
- '../grafana/datasources:/sg_config_grafana/provisioning/datasources'
|
|
- '../grafana/dashboards:/sg_grafana_additional_dashboards'
|
|
ports:
|
|
- '0.0.0.0:3370:3370'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
|
|
# Description: Publishes Prometheus metrics about Docker containers.
|
|
#
|
|
# Disk: none
|
|
# Ports exposed to other Sourcegraph services: 8080/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
cadvisor:
|
|
container_name: cadvisor
|
|
image: 'index.docker.io/sourcegraph/cadvisor:187572_2022-12-06_cbecc5321c7d@sha256:755748f2f9b00d8f70bd65349e85235585bdf1a663e26198c8eaf91dfd5636e1'
|
|
cpus: 1
|
|
mem_limit: '1g'
|
|
# You may set `privileged` to `false and `cadvisor` will run with reduced privileges.
|
|
# `cadvisor` requires root privileges in order to display provisioning metrics.
|
|
# These metrics provide critical information to help you scale the Sourcegraph deployment.
|
|
# If you would like to bring your own infrastructure monitoring & alerting solution,
|
|
# you may want to remove the `cadvisor` container completely
|
|
privileged: true
|
|
volumes:
|
|
- '/:/rootfs:ro'
|
|
- '/var/run:/var/run:ro'
|
|
- '/sys:/sys:ro'
|
|
- '/var/lib/docker/:/var/lib/docker:ro'
|
|
- '/dev/disk/:/dev/disk:ro'
|
|
# Uncomment to enable container monitoring on MacOS
|
|
# - '/var/run/docker.sock:/var/run/docker.sock:ro'
|
|
devices:
|
|
- '/dev/kmsg'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
command:
|
|
- --port=8080
|
|
|
|
# Description: Publishes Prometheus metrics about the machine's hardware / operating system.
|
|
#
|
|
# Disk: none
|
|
# Ports exposed to other Sourcegraph services: 9100/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
node-exporter:
|
|
container_name: node-exporter
|
|
image: 'index.docker.io/sourcegraph/node-exporter:187572_2022-12-06_cbecc5321c7d@sha256:2d9dcdf0b2226f0c3d550a64d2667710265462350a3ba9ebe37d0302bc64af0f'
|
|
cpus: .5
|
|
mem_limit: '1g'
|
|
pid: 'host'
|
|
volumes:
|
|
- /proc:/host/proc:ro
|
|
- /sys:/host/sys:ro
|
|
- /:/rootfs:ro
|
|
command:
|
|
- '--path.procfs=/host/proc'
|
|
- '--path.rootfs=/rootfs'
|
|
- '--path.sysfs=/host/sys'
|
|
- '--no-collector.wifi'
|
|
- '--no-collector.hwmon'
|
|
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
|
|
expose:
|
|
- 9100
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
|
|
# Description: PostgreSQL database for various data.
|
|
#
|
|
# Disk: 128GB / persistent SSD
|
|
# Ports exposed to other Sourcegraph services: 5432/TCP 9187/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
pgsql:
|
|
container_name: pgsql
|
|
image: 'index.docker.io/sourcegraph/postgres-12-alpine:187572_2022-12-06_cbecc5321c7d@sha256:44f6e9a51fafb99573cbd767f20f68913db5a02920c5974e4fa560735d745328'
|
|
cpus: 4
|
|
mem_limit: '4g'
|
|
shm_size: '1g'
|
|
healthcheck:
|
|
test: '/liveness.sh'
|
|
interval: 10s
|
|
timeout: 1s
|
|
retries: 10
|
|
start_period: 1h
|
|
volumes:
|
|
- 'pgsql:/data/'
|
|
- '../pgsql/conf:/conf/'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
stop_grace_period: 120s
|
|
|
|
# Description: This container will collect and expose prometheus metrics about `pgsql` PostgreSQL server.
|
|
#
|
|
# Disk: None
|
|
# Ports exposed to other Sourcegraph services: 9187/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
# If you're using a DB instance hosted outside of docker-compose, the environment variables
|
|
# for this container will need to be updated to reflect the new connection information.
|
|
pgsql-exporter:
|
|
container_name: pgsql-exporter
|
|
image: 'index.docker.io/sourcegraph/postgres_exporter:187572_2022-12-06_cbecc5321c7d@sha256:85d9ca134db535f0482e6e5cacf194ea118bf24d0fd52e36ba6714802d59c30a'
|
|
cpus: 0.1
|
|
mem_limit: '50m'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
environment:
|
|
- 'DATA_SOURCE_NAME=postgres://sg:@pgsql:5432/?sslmode=disable'
|
|
- 'PG_EXPORTER_EXTEND_QUERY_PATH=/config/queries.yaml'
|
|
|
|
# Description: PostgreSQL database for code intelligence data.
|
|
#
|
|
# Disk: 128GB / persistent SSD
|
|
# Network: 1Gbps
|
|
# Ports exposed to other Sourcegraph services: 5432/TCP 9187/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
codeintel-db:
|
|
container_name: codeintel-db
|
|
image: 'index.docker.io/sourcegraph/codeintel-db:187572_2022-12-06_cbecc5321c7d@sha256:7fb02a9392ce4dd3d4210dbd5792c09c4210a2dfc6dc389ed679137784359102'
|
|
cpus: 4
|
|
mem_limit: '4g'
|
|
shm_size: '1g'
|
|
healthcheck:
|
|
test: '/liveness.sh'
|
|
interval: 10s
|
|
timeout: 1s
|
|
retries: 10
|
|
start_period: 1h
|
|
volumes:
|
|
- 'codeintel-db:/data/'
|
|
- '../codeintel-db/conf:/conf/'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
stop_grace_period: 120s
|
|
|
|
# Description: This container will collect and expose prometheus metrics about `codeintel-db` PostgreSQL server.
|
|
#
|
|
# Disk: None
|
|
# Ports exposed to other Sourcegraph services: 9187/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
# If you're using a DB instance hosted outside of docker-compose, the environment variables
|
|
# for this container will need to be updated to reflect the new connection information.
|
|
codeintel-db-exporter:
|
|
container_name: codeintel-db-exporter
|
|
image: 'index.docker.io/sourcegraph/postgres_exporter:187572_2022-12-06_cbecc5321c7d@sha256:85d9ca134db535f0482e6e5cacf194ea118bf24d0fd52e36ba6714802d59c30a'
|
|
cpus: 0.1
|
|
mem_limit: '50m'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
environment:
|
|
- 'DATA_SOURCE_NAME=postgres://sg:@codeintel-db:5432/?sslmode=disable'
|
|
- 'PG_EXPORTER_EXTEND_QUERY_PATH=/config/code_intel_queries.yaml'
|
|
|
|
# Description: PostgreSQL database for code insights data.
|
|
#
|
|
# Disk: 128GB / persistent SSD
|
|
# Network: 1Gbps
|
|
# Ports exposed to other Sourcegraph services: 5432/TCP 9187/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
codeinsights-db:
|
|
container_name: codeinsights-db
|
|
image: 'index.docker.io/sourcegraph/codeinsights-db:187572_2022-12-06_cbecc5321c7d@sha256:4dd89a1279e7d55ddcb5b570d0bb544422dd1ecb0e3662f23d22f9643837c2b5'
|
|
cpus: 4
|
|
mem_limit: '2g'
|
|
shm_size: '1g'
|
|
environment:
|
|
- POSTGRES_PASSWORD=password
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_DB=postgres
|
|
- PGDATA=/var/lib/postgresql/data/pgdata
|
|
healthcheck:
|
|
test: '/liveness.sh'
|
|
interval: 10s
|
|
timeout: 1s
|
|
retries: 10
|
|
start_period: 1h
|
|
volumes:
|
|
- 'codeinsights-db:/var/lib/postgresql/data/'
|
|
- '../codeinsights-db/conf:/conf/'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
stop_grace_period: 120s
|
|
|
|
# Description: This container will collect and expose prometheus metrics about `codeinsights-db` PostgreSQL server.
|
|
#
|
|
# Disk: None
|
|
# Ports exposed to other Sourcegraph services: 9187/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
# If you're using a DB instance hosted outside of docker-compose, the environment variables
|
|
# for this container will need to be updated to reflect the new connection information.
|
|
codeinsights-db-exporter:
|
|
container_name: codeinsights-db-exporter
|
|
image: 'index.docker.io/sourcegraph/postgres_exporter:187572_2022-12-06_cbecc5321c7d@sha256:85d9ca134db535f0482e6e5cacf194ea118bf24d0fd52e36ba6714802d59c30a'
|
|
cpus: 0.1
|
|
mem_limit: '50m'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
environment:
|
|
- 'DATA_SOURCE_NAME=postgres://postgres:password@codeinsights-db:5432/?sslmode=disable'
|
|
- 'PG_EXPORTER_EXTEND_QUERY_PATH=/config/code_insights_queries.yaml'
|
|
|
|
# Description: generic S3-like blobstore for storing LSIF uploads.
|
|
#
|
|
# Disk: 128GB / persistent SSD
|
|
# Network: 1Gbps
|
|
# Ports exposed to other Sourcegraph services: 9000/TCP
|
|
# Ports exposed to public internet: none
|
|
#
|
|
blobstore:
|
|
container_name: blobstore
|
|
image: 'index.docker.io/sourcegraph/blobstore:187572_2022-12-06_cbecc5321c7d@sha256:8e57384c78a3b31cbe31d41656dbcbb8ee7279d96630a33936a2098afabb1317'
|
|
cpus: 1
|
|
mem_limit: '1g'
|
|
healthcheck:
|
|
test: ['CMD', 'curl', '-f', 'http://127.0.0.1:9000/']
|
|
interval: 10s
|
|
timeout: 1s
|
|
retries: 3
|
|
start_period: 15s
|
|
volumes:
|
|
- 'blobstore:/data'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
|
|
# Description: Redis for storing short-lived caches.
|
|
#
|
|
# Disk: 128GB / persistent SSD
|
|
# Ports exposed to other Sourcegraph services: 6379/TCP 9121/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
redis-cache:
|
|
container_name: redis-cache
|
|
image: 'index.docker.io/sourcegraph/redis-cache:187572_2022-12-06_cbecc5321c7d@sha256:bb62b6d761513b1651e8499532570068a4509d5d0cf5131f0dd8b8e2ef74c72d'
|
|
cpus: 1
|
|
mem_limit: '7g'
|
|
volumes:
|
|
- 'redis-cache:/redis-data'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
# Description: Redis for storing semi-persistent data like user sessions.
|
|
#
|
|
# Disk: 128GB / persistent SSD
|
|
# Ports exposed to other Sourcegraph services: 6379/TCP 9121/TCP
|
|
# Ports exposed to the public internet: none
|
|
#
|
|
redis-store:
|
|
container_name: redis-store
|
|
image: 'index.docker.io/sourcegraph/redis-store:187572_2022-12-06_cbecc5321c7d@sha256:a3e4f611bcf1fe6f256a54b81f6ddb9fc2e45d7a038fa276b800b895eca09fe5'
|
|
cpus: 1
|
|
mem_limit: '7g'
|
|
volumes:
|
|
- 'redis-store:/redis-data'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
|
|
# Description: Ingests and exports OpenTelemetry data.
|
|
#
|
|
# Ports exposed to other Sourcegraph services: 4317 (receiver), 55679 (zpages)
|
|
# Ports exposed to the public internet: none
|
|
otel-collector:
|
|
container_name: otel-collector
|
|
image: 'index.docker.io/sourcegraph/opentelemetry-collector:187572_2022-12-06_cbecc5321c7d@sha256:113a84fcef33f06f7e529961d5eb64400488953b23ac07ea8a3d628db6789ef0'
|
|
cpus: 1
|
|
mem_limit: '1g'
|
|
networks:
|
|
- sourcegraph
|
|
restart: always
|
|
# Default configurations are shipped in '/etc/otel-collector/configs/'
|
|
command: ['--config', '/etc/otel-collector/configs/logging.yaml']
|
|
volumes:
|
|
- '../otel-collector/config.yaml:/etc/otel-collector/config.yaml'
|
|
|
|
volumes:
|
|
caddy:
|
|
gitserver-0:
|
|
grafana:
|
|
pgsql:
|
|
codeintel-db:
|
|
codeinsights-db:
|
|
blobstore:
|
|
prometheus-v2:
|
|
redis-cache:
|
|
redis-store:
|
|
repo-updater:
|
|
worker:
|
|
searcher-0:
|
|
sourcegraph-frontend-0:
|
|
sourcegraph-frontend-internal-0:
|
|
symbols-0:
|
|
zoekt-0-shared:
|
|
networks:
|
|
sourcegraph:
|