Docker Development Environment
Relevant source files
The following files were used as context for generating this wiki page:
The Docker Development Environment in KamehaDB provides a standardized, containerized set of database services to facilitate local development and testing. By utilizing Docker Compose, developers can spin up instances of PostgreSQL, MySQL, MariaDB, Redis, and Qdrant with pre-configured credentials and seed data that match the application's connection defaults.
Sources: README.md:38-42, AGENTS.md:25-28, PLAN.md:238-241
Service Architecture
The environment consists of five primary database containers managed by a single docker-compose.yml file. These services are exposed on standard ports to the host machine, allowing the KamehaDB desktop application and sidecar to interact with them as if they were running natively.
The diagram above illustrates how the local KamehaDB application components (Desktop and Sidecar) interface with the containerized database services provided by Docker.
Sources: docker-compose.yml:1-53, AGENTS.md:15-21, PLAN.md:104-121
Configuration and Credentials
The development environment uses a consistent set of credentials across relational databases to simplify local testing. These values are defined as environment variables within the Docker configuration and correspond to the "Connection Defaults" used within the application UI.
Connection Default Table
| Service | Port | Image | Username | Password | Database |
|---|---|---|---|---|---|
| PostgreSQL | 5432 | postgres:17-alpine | kameha | kameha | kamehadb |
| MySQL | 3306 | mysql:8.4 | kameha | kameha | kamehadb |
| MariaDB | 3307 | mariadb:11.4 | kameha | kameha | kamehadb |
| Redis | 6379 | redis:7-alpine | N/A | N/A | N/A |
| Qdrant | 6333 | qdrant/qdrant:v1.13.6 | N/A | N/A | N/A |
Sources: docker-compose.yml:4-46, README.md:52-59, AGENTS.md:139-146
Initialization and Seeding
The environment leverages Docker's initialization scripts to automatically populate databases with sample data upon creation. This is achieved by mounting the ./docker-init directory to the respective container's initialization paths (e.g., /docker-entrypoint-initdb.d).
Seed Data Schema
The provided seed scripts for PostgreSQL and MySQL create a consistent schema representing a simple organizational structure:
The ER diagram displays the relational structure generated by the 01-seed.sql scripts provided for both Postgres and MySQL.
Sources: docker-init/postgres/01-seed.sql:1-35, docker-init/mysql/01-seed.sql:6-45
Resource Management
Persistence
Data persistence is handled through named Docker volumes, ensuring that database state remains intact even if containers are stopped or removed.
postgres_data: Persistent storage for PostgreSQL.mysql_data: Persistent storage for MySQL.mariadb_data: Persistent storage for MariaDB.redis_data: Persistent storage for Redis.qdrant_data: Persistent storage for Qdrant vector data.
Sources: docker-compose.yml:48-53
Lifecycle Commands
Management of the environment is performed via standard Docker Compose commands at the project root.
# Start all database services in detached mode
docker compose up -d
# Start a specific service (e.g., Qdrant)
docker compose up -d qdrant
# Stop and remove all containers while preserving volumes
docker compose down
# View logs for the database services
docker compose logs -f
Sources: README.md:43-45, AGENTS.md:43-44, CHANGELOG.md:13-14
Summary
The Docker Development Environment is a critical component for KamehaDB developers, providing a pre-configured suite of databases (Postgres, MySQL, MariaDB, Redis, and Qdrant) that match the application's internal connection defaults. By using initialization scripts in docker-init/, it ensures that every developer starts with a consistent dataset for testing schema browsing, SQL generation, and AI-driven queries.