Skip to content

docs/self-hosted: Use override files for Docker Compose executors, and --remove-orphans on every up - #2186

Open
marcleblanc2 wants to merge 2 commits into
mainfrom
marc/executors-docker-override-file
Open

marcleblanc2 wants to merge 2 commits into
mainfrom
marc/executors-docker-override-file

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

The Docker Compose executors page told customers to edit executor.docker-compose.yaml in their clone of deploy-sourcegraph-docker. That file pins the executor image to the release, so customers who edit it get merge conflicts on every upgrade, and the upgrade section told them to hand-edit the image tag.

This change matches the main Docker Compose guidance:

  • Same machine as Sourcegraph: add an executor service to the existing docker-compose.override.yaml, and pass the base file, the executor file, and the override file to docker compose. A callout warns that once the override configures executor, every command needs the executor file too, or Compose fails with service "executor" has neither an image nor a build context specified.

  • Standalone machine: an executor.docker-compose.override.yaml next to the executor file that sets EXECUTOR_FRONTEND_URL and declares the sourcegraph network. executor.docker-compose.yaml joins that network but does not declare it, so on its own it fails with service "executor" refers to undefined network sourcegraph.

  • Upgrades: check out the target tag and rerun the same up -d command. If an override sets image, remove it.

  • The link to the compose file now points to main, not master.

  • Every docker compose up command and mention under docs/self-hosted now passes --remove-orphans, including the commands that start only some services (the databases, migrator) and the db-only-migrate.docker-compose.yaml restore step. Without it, containers for services that are no longer in the Compose files passed to the command keep running. The upgrade, configuration, and cloud-provider pages already used it.

Test plan

  • Copied both YAML snippets from the page and validated them against deploy-sourcegraph-docker main with Docker Compose v2.40.3:
    • docker compose -f docker-compose.yaml -f executors/executor.docker-compose.yaml -f <same-machine snippet> config: the executor keeps the image from the base file, gets the password and EXECUTOR_QUEUE_NAMES from the override, and keeps EXECUTOR_FRONTEND_URL=http://sourcegraph-frontend-0:3080.
    • docker compose -f executor.docker-compose.yaml -f <standalone snippet> config passes. Without the networks block it fails with the undefined network error above.
    • Leaving out executors/executor.docker-compose.yaml while the override configures executor gives the error quoted in the callout.
  • The base file sets EXECUTOR_QUEUE_NAME= (empty), and the snippets set EXECUTOR_QUEUE_NAMES. The executor's config validation only rejects the pair when both are non-empty.
  • pnpm run check links --check-anchors --check-self-links against the merge base: no new dead links. dev/check-hostnames.mjs: no findings.
  • rg -n 'compose[^\n]*\bup\b' docs | rg -v remove-orphans now matches only prose that isn't a command (the migrator's own up command and an AWS install sentence). docker compose up --help (v2.40.3) lists --remove-orphans.

The Docker Compose executor page told customers to edit
executor.docker-compose.yaml, which pins the executor image, so every
upgrade meant a merge conflict or a hand-edited image tag. Show an
override file for the same-machine and standalone cases instead, and
make upgrades a tag checkout plus the same up command.

Generated with an agent.

Amp-Thread-ID: https://ampcode.com/threads/T-01a20e40-0e0d-7419-8fad-9e9cf5b37b66
Co-authored-by: Amp <amp@ampcode.com>
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Nov 24, 2026 9:01pm UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR adds 1 duplicated pair(s) of passages

Passages this PR added, with the places that already say the same thing. Each added passage also has an inline comment.

2 passages, at least 59% similar

Each fact has one home in the docs. Keep the passage on the page that owns the topic, and replace the others with a sentence and a link to it, so they cannot drift apart. Before writing a config snippet, search docs/ for the key and link to the existing one.

Reproduce locally with node dev/check-duplicates.mjs --diff <(git diff -U0 origin/main).


Start Sourcegraph and the executor with the base file, the executor file, and your override file, in that order, from the `docker-compose` directory:

```bash

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This passage says the same thing as:

Each fact has one home in the docs. Keep the passage on the page that owns the topic, and replace the others with a sentence and a link to it, so they cannot drift apart. Before writing a config snippet, search docs/ for the key and link to the existing one.

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor
Page Before After Diff
/self-hosted/deploy/docker-compose/configuration prod preview −1 +1
/self-hosted/deploy/docker-compose prod preview −1 +1
/self-hosted/deploy/docker-compose/operations prod preview −2 +2
/self-hosted/deploy/docker-compose/upgrade prod preview −2 +2
/self-hosted/executors/deploy-executors-docker prod preview −26 +73
/self-hosted/how-to/upgrade-postgres-12-16-builtin-dbs prod preview −1 +1
/self-hosted/postgresql-collation-version-mismatch-resolution prod preview −1 +1
/self-hosted/updates/migrator/downgrading prod preview −2 +2
/self-hosted/updates/migrator/migrator-operations prod preview −1 +1

…mmand

Without it, containers for services removed from the compose files, or
left over from a Compose file the customer no longer passes, keep
running after docker compose up.

Generated with an agent.

Amp-Thread-ID: https://ampcode.com/threads/T-01a20e40-0e0d-7419-8fad-9e9cf5b37b66
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2 marcleblanc2 changed the title docs/executors: Configure Docker Compose executors with an override file docs/self-hosted: Use override files for Docker Compose executors, and --remove-orphans on every up Nov 24, 2026

This branch was successfully deployed

1 active deployment
Preview — f6d68ee8 Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant