Skip to content

chore: remove embedded Postgres, Redis, secrets from Docker image#1264

Merged
brendan-kellam merged 8 commits into
v5from
brendan/remove-embedded-postgres-redis-SOU-1269
Jun 3, 2026
Merged

chore: remove embedded Postgres, Redis, secrets from Docker image#1264
brendan-kellam merged 8 commits into
v5from
brendan/remove-embedded-postgres-redis-SOU-1269

Conversation

@brendan-kellam
Copy link
Copy Markdown
Contributor

Fixes SOU-1269

Summary

As part of the v5 release, this removes the Postgres and Redis that were bundled inside the shipped Docker image. External Postgres and Redis are now required and must be provided via DATABASE_URL and REDIS_URL. The image now contains only the app (web + backend + zoekt).

Compose and Helm deployments already run their own Postgres/Redis, so they are unaffected. Only deployments that relied on the embedded services (typically a bare docker run without DATABASE_URL/REDIS_URL) need to migrate.

Changes

  • Dockerfile: drop postgresql16, postgresql16-contrib, and redis packages; remove DATABASE_DATA_DIR/REDIS_DATA_DIR env vars; remove the postgres/redis users and the /run/postgresql setup.
  • entrypoint.sh: when DATABASE_URL or REDIS_URL is unset, hard-fail with a clear error pointing at the migration guide instead of falling back to embedded mode; remove the initdb, data-dir init, and embedded-postgres startup blocks.
  • supervisord.conf: remove the redis program (zoekt/web/backend remain).
  • Docs:
    • environment-variables.mdx: mark DATABASE_URL/REDIS_URL as required; remove the DATABASE_DATA_DIR/REDIS_DATA_DIR rows.
    • v4-to-v5-guide.mdx: document the breaking change, who's affected, and step-by-step pg_dump/pg_restore data migration.
  • CHANGELOG.md: breaking-change entry under [Unreleased] → Changed.

Notes

  • App code (packages/shared/db.ts, web/prisma.ts, backend/redis.ts) is untouched — it never branched on embedded mode.
  • docker-compose.yml needs no change; it already runs external Postgres (:16, matching the previously-bundled version) and Redis with the URLs injected.

🤖 Generated with Claude Code

As of v5, Sourcebot no longer ships an embedded Postgres or Redis.
External instances are now required via DATABASE_URL and REDIS_URL.

- Dockerfile: drop postgresql16/redis packages, DATABASE_DATA_DIR/
  REDIS_DATA_DIR env, postgres/redis users, and /run/postgresql setup
- entrypoint.sh: hard-fail with guidance when DATABASE_URL/REDIS_URL are
  unset; remove embedded init/startup blocks
- supervisord.conf: remove the redis program
- docs: mark DATABASE_URL/REDIS_URL required, drop data-dir vars, document
  the breaking change and data migration in the v4-to-v5 guide
- CHANGELOG: note the breaking change

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7fd85c62-5294-41c1-82ce-839165765f6f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch brendan/remove-embedded-postgres-redis-SOU-1269

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

brendan-kellam and others added 3 commits June 2, 2026 14:31
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…TION_KEY

- entrypoint.sh: require AUTH_SECRET and SOURCEBOT_ENCRYPTION_KEY explicitly
  (no auto-generation, no plaintext file loading); hard-fail with migration
  guidance and warn if the legacy plaintext files linger
- v4-to-v5 guide: document the secrets, role-management, and external
  Postgres/Redis breaking changes with per-item migration steps
- environment-variables: mark both secrets required
- roles-and-permissions: add default-role-by-plan table
- CHANGELOG: update breaking-change entries

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@brendan-kellam brendan-kellam changed the title chore: remove embedded Postgres and Redis from the Docker image chore: remove embedded Postgres, Redis, secrets from Docker image Jun 3, 2026
@brendan-kellam
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@brendan-kellam brendan-kellam merged commit eedfef3 into v5 Jun 3, 2026
3 checks passed
@brendan-kellam brendan-kellam deleted the brendan/remove-embedded-postgres-redis-SOU-1269 branch June 3, 2026 01:34
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