# docker-compose.yml — Local PostgreSQL for CleverAgents server-mode development
#
# Usage:
#   docker compose up -d          # start PostgreSQL
#   docker compose down -v        # tear down and remove data volume
#
# Connect from CleverAgents:
#   export CLEVERAGENTS_SERVER_MODE=true
#   export CLEVERAGENTS_DATABASE_URL=postgresql://cleveragents:cleveragents@localhost:5432/cleveragents

services:
  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: cleveragents
      # WARNING: Development credentials only — do not use in production
      POSTGRES_PASSWORD: cleveragents
      POSTGRES_DB: cleveragents
    ports:
      - "5432:5432"
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U cleveragents"]
      interval: 5s
      timeout: 5s
      retries: 5

volumes:
  pgdata:
