dbx/deploy/database
二丫讲梵 d01cf2f9b5
fix(database): correct r-nacos image and port docs
2026-07-23 17:29:38 +08:00
..
clickhouse/24.8 feat(database-lab): add local database test environments 2026-07-18 22:11:35 +08:00
completion feat(database-lab): add local database test environments 2026-07-18 22:11:35 +08:00
etcd/3.7 feat(database): add Nacos Pulsar Qdrant and ZooKeeper recipes 2026-07-20 01:51:45 +08:00
kafka/4.3 feat(database): add Nacos Pulsar Qdrant and ZooKeeper recipes 2026-07-20 01:51:45 +08:00
mariadb/10.11 feat(database-lab): add local database test environments 2026-07-18 22:11:35 +08:00
mongodb feat(database-lab): add local database test environments 2026-07-18 22:11:35 +08:00
mysql feat(database-lab): add local database test environments 2026-07-18 22:11:35 +08:00
nacos feat(database): add Nacos Pulsar Qdrant and ZooKeeper recipes 2026-07-20 01:51:45 +08:00
postgresql feat(database-lab): add local database test environments 2026-07-18 22:11:35 +08:00
pulsar/4.2 feat(database): add Nacos Pulsar Qdrant and ZooKeeper recipes 2026-07-20 01:51:45 +08:00
qdrant/1.8 feat(database): add Nacos Pulsar Qdrant and ZooKeeper recipes 2026-07-20 01:51:45 +08:00
redis feat(database-lab): add local database test environments 2026-07-18 22:11:35 +08:00
rnacos/0.8 fix(database): correct r-nacos image and port docs 2026-07-23 17:29:38 +08:00
zookeeper/3.9 feat(database): add Nacos Pulsar Qdrant and ZooKeeper recipes 2026-07-20 01:51:45 +08:00
README.md feat(database-lab): add local database test environments 2026-07-18 22:11:35 +08:00
README.zh-CN.md feat(database-lab): add local database test environments 2026-07-18 22:11:35 +08:00
RECIPE_TEMPLATE.md feat(database-lab): add local database test environments 2026-07-18 22:11:35 +08:00

README.md

DBX Database Test Environments

This directory contains reproducible Docker Compose environments for manual database verification. Each versioned recipe uses a pinned image, a named volume, a loopback-only port binding, a health check, and initialization data or smoke data created during verification.

Run commands from the repository root:

make db-list
make db DB=mysql@8.4
make db-verify DB=postgresql@17.4
make db-down DB=postgresql@17.4

Every network recipe uses the standard database port plus one on the host. The default password is 123456, and the default database is dbx; Redis uses DB 0 and the dbx: key prefix. Container names follow dbx-<product>-<version>. Versions of the same database share the default host port, so use DB_PORT when running them concurrently. DB_PORT and DB_PASSWORD override the default host port and password. Ports bind to 127.0.0.1 by default. To allow remote access explicitly, set DB_BIND_ADDRESS=0.0.0.0, choose a strong DB_PASSWORD, and protect the host with firewall rules. make db-reset deletes the named volume and therefore requires CONFIRM=1:

make db-reset DB=redis@7.4 CONFIRM=1

The primary Make targets are db-list, db, db-verify, db-down, db-reset, and db-check. Run make db to print one copyable start command for every recipe. make db-completion prints Bash, Zsh, and PowerShell completion setup; the scripts in completion/ dynamically complete recipe selectors. The targets avoid POSIX-shell conditionals and work with GNU Make in PowerShell, Git Bash, or WSL. For diagnosis, use the lower-level pnpm db:env -- info|status|logs|shell <product> <version> commands.

Recipe layout

<product>/<version>/
├── recipe.json   # connection fields and smoke commands
├── compose.yaml  # Docker Compose environment
└── init/         # data initialized with the environment

Redis does not support the image initialization-directory convention; its init/README.md documents the smoke key that verify creates and reads. Run make db-check after adding or editing a recipe. It verifies the recipe structure and standardized container name, then asks Docker Compose to validate each Compose file.