Simple docker-compose setup for CockroachDB (single-node)

version: '3.8'

services:
  cockroach:
    image: cockroachdb/cockroach:latest-v23.1
    volumes:
        - ./cockroach_data:/cockroach/cockroach-data
    command: start-single-node --insecure
    ports:
        - "26257:26257"
        - "22192:8080"

This will expose CockroackDB on port 26257 and the built-in webinterface on port 22192.

Note that this configuration (intentionally) doesnt use any authentication or other security features, nor does it use clustering.