Files
envbao-admin/docker-compose.yml
mattandClaude Sonnet 5.5 11c9483a88 Demo and CI: Postgres and SSH server for the dynamic engines
docker compose now runs a Postgres with sample tables and an SSH server
that trusts the CA in OpenBao's ssh/ engine. seed.sh configures the
database engine (dynamic and static roles), the ssh CA and a role, a few
live leases, and grants for alice and the platform group. CI gains a
Postgres service so the database engine and its admin-policy rules are
tested against a real database (skipped when BAO_PG_URL is unset).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 13:58:59 +00:00

71 lines
2.2 KiB
YAML

# Local demo: the UI, a throwaway in-memory OpenBao dev server, and the things its dynamic secrets engines
# manage: a Postgres database and an SSH server that trusts OpenBao's SSH CA.
# docker compose up --build
# UI: http://localhost:8080 OpenBao: http://localhost:8200 token: root
# Postgres: localhost:5433 (database "app") SSH: localhost:2222 (users "deploy" and "alice", certificates only)
services:
openbao:
image: openbao/openbao:latest
cap_add: [IPC_LOCK]
environment:
BAO_DEV_ROOT_TOKEN_ID: root
BAO_DEV_LISTEN_ADDRESS: 0.0.0.0:8200
ports:
- "8200:8200"
healthcheck:
test: ["CMD", "bao", "status", "-address=http://127.0.0.1:8200"]
interval: 2s
retries: 15
# Sample database for the "database" secrets engine. OpenBao connects as the "openbao" role (docker/postgres/init.sql).
postgres:
image: postgres:17-alpine
environment:
POSTGRES_DB: app
POSTGRES_PASSWORD: postgres-sample
volumes:
- ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
ports:
- "127.0.0.1:5433:5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "app"]
interval: 2s
retries: 15
# One-shot: allow the UI origin to call OpenBao from the browser, then load sample
# secrets, users, entities, a group, a token and the dynamic engines (see docker/seed.sh).
openbao-setup:
image: openbao/openbao:latest
depends_on:
openbao:
condition: service_healthy
postgres:
condition: service_healthy
environment:
BAO_ADDR: http://openbao:8200
BAO_TOKEN: root
volumes:
- ./docker/seed.sh:/seed.sh:ro
entrypoint: ["sh", "/seed.sh"]
restart: "no"
# Sample SSH server for the "ssh" secrets engine. It trusts the CA that seed.sh generates, so a certificate
# signed by OpenBao logs in; there are no passwords. See docker/sshd.
sshd:
build: ./docker/sshd
depends_on:
openbao-setup:
condition: service_completed_successfully
environment:
BAO_ADDR: http://openbao:8200
ports:
- "127.0.0.1:2222:22"
ui:
build: .
depends_on:
openbao-setup:
condition: service_completed_successfully
ports:
- "8080:80"