Skip to main content

systemprompt_cli/commands/cloud/tenant/docker/
mod.rs

1//! Local Docker-backed `PostgreSQL` provisioning for local tenants.
2//!
3//! Manages the shared `systemprompt-postgres` container and its volume, and
4//! creates, drops, and authorises per-tenant databases inside it via
5//! `docker exec psql`. Public surface: the shared-config types and the
6//! container/database lifecycle helpers consumed by the create/delete flows.
7//!
8//! Copyright (c) systemprompt.io — Business Source License 1.1.
9//! See <https://systemprompt.io> for licensing details.
10
11mod config;
12pub mod container;
13pub mod database;
14
15pub use config::SharedContainerConfig;
16pub(super) use config::{
17    SHARED_ADMIN_USER, SHARED_PORT, SHARED_VOLUME_NAME, load_shared_config, save_shared_config,
18};
19pub(in crate::commands::cloud) use container::wait_for_postgres_healthy;
20pub(super) use container::{
21    check_volume_exists, generate_admin_password, generate_shared_postgres_compose,
22    get_container_password, is_shared_container_running, nanoid, new_local_tenant_id,
23    remove_shared_volume, stop_shared_container,
24};
25pub(super) use database::{
26    create_database_for_tenant, drop_database_for_tenant, ensure_admin_role,
27};