Skip to content

Commit 0c5993a

Browse files
cosmic-floodclaude
andcommitted
docker/: move compose stack to top-level docker/ folder
Mirror the charts/ layout — docker/docker-compose.yml + docker/README.md sit at the repo root rather than being scattered across modules/ and docs/deployment/. docker/README.md takes over as the canonical Docker Compose deployment guide; old docs/deployment/ folder removed. - Rewrite docker/README.md as a charts/README.md-shaped guide (no .env references, paths relative to new home). - Update internal paths in docker/docker-compose.yml: schema.sql volume becomes ../modules/track-service/sql/schema.sql; quickstart hint reads cd docker. - Update root README.md and AGENTS.md call sites (compose/cd hints, directory tree). - Also gitignore */keyvault-secret-provider.local.yaml so per-cluster AKS overrides don't get tracked. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2fa0fa9 commit 0c5993a

5 files changed

Lines changed: 31 additions & 23 deletions

File tree

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,9 @@ data-process/stats-service/*.pyc
201201
data-process/stats-service/.venv/
202202
data-process/stats-service/venv/
203203
data-process/stats-service/.env
204-
!data-process/stats-service/.env.example
204+
!data-process/stats-service/.env.example
205+
206+
# ======
207+
# charts/ (Helm)
208+
# ======
209+
charts/featbit-rda/**/values.local.yaml

AGENTS.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Storage:
5353
ClickHouse ← track-service read/write
5454
```
5555

56-
The runtime services (web, track-service, run-active-test) are wired together in `modules/docker-compose.yml`. The local-mode connector is published to npm and is **not** part of `docker compose` — each end user runs it themselves on their own machine.
56+
The runtime services (web, track-service, run-active-test) are wired together in `docker/docker-compose.yml`. The local-mode connector is published to npm and is **not** part of `docker compose` — each end user runs it themselves on their own machine.
5757

5858
---
5959

@@ -304,10 +304,11 @@ npm run deploy
304304

305305
## 🐳 Docker Compose
306306

307-
One self-contained compose file. All values are hard-coded — no `.env`, no `${}` substitution. To customize anything (image tag, passwords, FeatBit URL, signing key, sandbox0 key), edit `modules/docker-compose.yml` directly.
307+
One self-contained compose file. All values are hard-coded — no `.env`, no `${}` substitution. To customize anything (image tag, passwords, FeatBit URL, signing key, sandbox0 key), edit `docker/docker-compose.yml` directly.
308308

309309
```
310-
modules/
310+
docker/
311+
README.md ← deployment guide
311312
docker-compose.yml ← single source of truth: image tags, ports, env, volumes, the x-signing-key anchor
312313
```
313314

@@ -327,7 +328,7 @@ The `Local Claude Code` chat path is **not** a docker service — users run `npx
327328
### Start / Stop
328329

329330
```bash
330-
cd modules
331+
cd docker
331332

332333
# 1. Replace REPLACE_ME in the x-signing-key anchor at the top of docker-compose.yml
333334
# 2. Bring it up:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The FeatBit Release Decision Agent is built **on top of** the FeatBit feature-fl
2525

2626
**SaaS path** — sign up at **[featbit.co](https://featbit.co)** and you're done; FeatBit + RDA are bundled.
2727

28-
**Self-host path** — install FeatBit first from **[github.com/featbit/featbit](https://github.com/featbit/featbit)** (Docker Compose or Helm). Replace `FEATBIT_API_URL` on the `web` block in `modules/docker-compose.yml` (or set `web.featbit.apiUrl` in Helm values) to point RDA's web at your FeatBit — runtime env, no rebuild required.
28+
**Self-host path** — install FeatBit first from **[github.com/featbit/featbit](https://github.com/featbit/featbit)** (Docker Compose or Helm). Replace `FEATBIT_API_URL` on the `web` block in `docker/docker-compose.yml` (or set `web.featbit.apiUrl` in Helm values) to point RDA's web at your FeatBit — runtime env, no rebuild required.
2929

3030
PostgreSQL and ClickHouse are bundled into the Docker Compose stack and bootstrap themselves on first boot — you don't have to provision them. You can override the connection strings to point at your own databases instead; see the deployment guides.
3131

@@ -37,7 +37,7 @@ The fastest path is the hosted version: sign up at **[featbit.co](https://featbi
3737

3838
#### 2. Self-host with Docker Compose
3939

40-
Full step-by-step guide: **[`docs/deployment/docker.md`](docs/deployment/docker.md)**.
40+
Full step-by-step guide: **[`docker/README.md`](docker/README.md)**.
4141

4242
#### 3. Self-host with Helm on Kubernetes
4343

@@ -118,7 +118,7 @@ Every experiment carries a `dataSourceMode`. The default (`featbit-managed`) pul
118118

119119
- **[`AGENTS.md`](AGENTS.md)** — full service map, environment variables, troubleshooting, and the canonical metric storage contract.
120120
- **[`WHITE_PAPER.md`](WHITE_PAPER.md)** — product thesis and market positioning.
121-
- **[`docs/deployment/docker.md`](docs/deployment/docker.md)** — Docker Compose deployment, end to end.
121+
- **[`docker/README.md`](docker/README.md)** — Docker Compose deployment, end to end.
122122
- **[`charts/README.md`](charts/README.md)** — Helm chart deployment: install, prerequisites, layout, design decisions, AKS examples.
123123
- **[`docs/usage/`](docs/usage/)** — usage docs (placeholder until the docs site is published).
124124
- **[`skills/featbit-release-decision/`](skills/featbit-release-decision/)** — the release-decision workflow + CF-01 → CF-08 phase definitions.
Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
# Docker Compose deployment
1+
# FeatBit RDA Docker Compose stack
22

3-
The compose stack ships everything in one command — web, track-service, PostgreSQL, ClickHouse. Both database schemas bootstrap themselves on first boot, so there is nothing to apply by hand.
3+
Self-contained Docker Compose stack — `web`, `track-service`, PostgreSQL, ClickHouse — for single-host deployments and local trials. Both database schemas bootstrap themselves on first boot, so there is nothing to apply by hand.
4+
5+
---
46

57
## What ships
68

79
| Service | Image | Port | Notes |
810
|---|---|---|---|
9-
| `web` | `featbit/featbit-rda-web:${VERSION}` | `3000` | Runs `prisma migrate deploy` against `DATABASE_URL` on every container start. |
10-
| `track-service` | `featbit/featbit-rda-track-service:${VERSION}` | `5050 → 8080` | Event ingest + per-experiment metric query. |
11+
| `web` | `featbit/featbit-rda-web:0.0.4-beta` | `3000` | Runs `prisma migrate deploy` against `DATABASE_URL` on every container start. |
12+
| `track-service` | `featbit/featbit-rda-track-service:0.0.4-beta` | `5050 → 8080` | Event ingest + per-experiment metric query. |
1113
| `postgres` | `postgres:16-alpine` | `5432` | Persistent volume `pg_data`. |
12-
| `clickhouse` | `clickhouse/clickhouse-server:24-alpine` | `8123`, `9000` | Auto-applies `track-service/sql/schema.sql` from `/docker-entrypoint-initdb.d/` on first boot. Persistent volume `ch_data`. |
14+
| `clickhouse` | `clickhouse/clickhouse-server:24-alpine` | `8123`, `9000` | Auto-applies `modules/track-service/sql/schema.sql` from `/docker-entrypoint-initdb.d/` on first boot. Persistent volume `ch_data`. |
1315

14-
External dependency that **isn't** in the stack: a running FeatBit instance ([`github.com/featbit/featbit`](https://github.com/featbit/featbit)). Defaults to FeatBit SaaS (`https://app-api-experimentation.featbit.co`); self-hosters set `FEATBIT_API_URL` in `.env`.
16+
External dependency that **isn't** in the stack: a running FeatBit instance ([`github.com/featbit/featbit`](https://github.com/featbit/featbit)). Defaults to FeatBit SaaS (`https://app-api-experimentation.featbit.co`); self-hosters replace `FEATBIT_API_URL` on the `web` block.
1517

1618
---
1719

1820
## Quickstart
1921

2022
The compose file is self-contained — no `.env`, no variable substitution. Two steps:
2123

22-
**1. Set the cross-service signing key.** Open `modules/docker-compose.yml` and replace the `REPLACE_ME` placeholder in the `x-signing-key` anchor near the top with a long random string. Both `web` and `track-service` reference the anchor, so you only edit one place.
24+
**1. Set the cross-service signing key.** Open `docker/docker-compose.yml` and replace the `REPLACE_ME` placeholder in the `x-signing-key` anchor near the top with a long random string. Both `web` and `track-service` reference the anchor, so you only edit one place.
2325

2426
Generate a key:
2527

@@ -36,7 +38,7 @@ openssl rand -base64 48
3638
**2. Bring the stack up.**
3739

3840
```bash
39-
cd modules
41+
cd docker
4042
docker compose up -d
4143
```
4244

@@ -50,7 +52,7 @@ RDA delegates authentication to **FeatBit** — there is no separate user databa
5052

5153
1. Make sure you have a FeatBit account on either:
5254
- [**featbit.co**](https://featbit.co) (FeatBit SaaS — default), or
53-
- your **self-hosted FeatBit instance** ([`github.com/featbit/featbit`](https://github.com/featbit/featbit)). Set `FEATBIT_API_URL` in `.env` and re-`up -d` web before logging in.
55+
- your **self-hosted FeatBit instance** ([`github.com/featbit/featbit`](https://github.com/featbit/featbit)). Replace `FEATBIT_API_URL` on the `web` block in `docker-compose.yml` and re-`up -d` web before logging in.
5456
2. On the login page, enter your FeatBit email + password. RDA forwards the credentials to FeatBit, gets back a JWT, and creates a session.
5557

5658
If FeatBit is unreachable, login fails — check the [troubleshooting](#troubleshooting) row for *Browser login redirects in a loop*.
@@ -59,7 +61,7 @@ If FeatBit is unreachable, login fails — check the [troubleshooting](#troubles
5961

6062
## Configuration
6163

62-
All knobs live in `modules/docker-compose.yml`. Edit the file directly — there is no `.env` layer. The fields you'll actually touch:
64+
All knobs live in `docker-compose.yml`. Edit the file directly — there is no `.env` layer. The fields you'll actually touch:
6365

6466
| Field (in compose) | Default | What it does |
6567
|---|---|---|
@@ -89,7 +91,7 @@ docker compose up -d web track-service postgres
8991
Two things to know:
9092

9193
- **External PG**: the role in `DATABASE_URL` needs `CREATE` / `ALTER` privileges (web runs `prisma migrate deploy` on every start).
92-
- **External CH**: apply the schema once before first run — `clickhouse-client --queries-file modules/track-service/sql/schema.sql` (idempotent).
94+
- **External CH**: apply the schema once before first run — `clickhouse-client --queries-file modules/track-service/sql/schema.sql` (idempotent; path is repo-root-relative).
9395

9496
### Web only (no track-service / ClickHouse)
9597

@@ -103,7 +105,7 @@ docker compose up -d web postgres
103105

104106
## Going to production
105107

106-
Compose is fine for a single host. For HA, autoscaling, ingress + TLS, secret projection from Key Vault, and pod disruption budgets, use the Helm chart instead — see [`charts/README.md`](../../charts/README.md).
108+
Compose is fine for a single host. For HA, autoscaling, ingress + TLS, secret projection from Key Vault, and pod disruption budgets, use the Helm chart instead — see [`../charts/README.md`](../charts/README.md).
107109

108110
---
109111

@@ -119,4 +121,4 @@ Compose is fine for a single host. For HA, autoscaling, ingress + TLS, secret pr
119121
| Chat panel returns `401: missing authorization header` | `SANDBOX0_API_KEY` is `""` in `docker-compose.yml`. |
120122
| `clickhouse` container doesn't apply `schema.sql` | The init scripts only run when the data dir is empty. Wipe and re-init: `docker compose down -v` then `docker compose up -d` |
121123

122-
For the full service map and env-var reference, see [`AGENTS.md`](../../AGENTS.md).
124+
For the full service map and env-var reference, see [`../AGENTS.md`](../AGENTS.md).
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# 1. Replace REPLACE_ME below with a long random string. Generate one:
88
# macOS / Linux: openssl rand -base64 48
99
# Windows (PS 7+): [Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(48))
10-
# 2. cd modules && docker compose up -d
10+
# 2. cd docker && docker compose up -d
1111
# 3. open http://localhost:3000
1212

1313
# Shared HMAC-SHA256 key for env-secret signing. web mints tokens, track-service
@@ -57,7 +57,7 @@ services:
5757
# First-boot schema apply. clickhouse-server runs *.sql in this dir as
5858
# part of init when the data dir is empty. Idempotent on re-runs anyway
5959
# (uses IF NOT EXISTS), but only the first boot triggers it.
60-
- ./track-service/sql/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro
60+
- ../modules/track-service/sql/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro
6161
ulimits:
6262
nofile:
6363
soft: 262144

0 commit comments

Comments
 (0)