Skip to content

Instantly share code, notes, and snippets.

@nexdrew
Created August 9, 2023 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nexdrew/1aa7537438dd90de049c98ee81ef03d8 to your computer and use it in GitHub Desktop.
Save nexdrew/1aa7537438dd90de049c98ee81ef03d8 to your computer and use it in GitHub Desktop.
docker compose config for simple 3-node insecure cockroach cluster
version: "3"
services:
db1:
image: "cockroachdb/cockroach:v23.1.8"
container_name: db1
hostname: db1
restart: on-failure
ports:
- "26257:26257"
- "8080:8080"
volumes:
- "./test-data/db1:/cockroach/cockroach-data"
command: "start --insecure --join=db1,db2,db3"
networks:
- testnet
db2:
image: "cockroachdb/cockroach:v23.1.8"
container_name: db2
hostname: db2
restart: on-failure
volumes:
- "./test-data/db2:/cockroach/cockroach-data"
command: "start --insecure --join=db1,db2,db3"
networks:
- testnet
db3:
image: "cockroachdb/cockroach:v23.1.8"
container_name: db3
hostname: db3
restart: on-failure
volumes:
- "./test-data/db3:/cockroach/cockroach-data"
command: "start --insecure --join=db1,db2,db3"
networks:
- testnet
networks:
testnet:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment