|
| 1 | +version: '3.9' |
| 2 | + |
| 3 | +# Took from: https://github.com/dbist/cockroach-docker |
| 4 | +# Connect to db console with: docker exec -it roach-0 ./cockroach sql --host=roach-0:26257 --insecure |
| 5 | + |
| 6 | +services: |
| 7 | + roach-0: |
| 8 | + container_name: roach-0 |
| 9 | + hostname: roach-0 |
| 10 | + image: cockroachdb/cockroach-unstable:v23.2.0-beta.1 |
| 11 | + command: start --insecure --join=roach-0,roach-1,roach-2 --listen-addr=roach-0:26257 --advertise-addr=roach-0:26257 --max-sql-memory=.25 --cache=.25 |
| 12 | + environment: |
| 13 | + - 'ALLOW_EMPTY_PASSWORD=yes' |
| 14 | + - 'COCKROACH_USER=postgres' |
| 15 | + - 'COCKROACH_PASSWORD=postgres' |
| 16 | + - 'COCKROACH_DATABASE=postgres' |
| 17 | + |
| 18 | + roach-1: |
| 19 | + container_name: roach-1 |
| 20 | + hostname: roach-1 |
| 21 | + image: cockroachdb/cockroach-unstable:v23.2.0-beta.1 |
| 22 | + command: start --insecure --join=roach-0,roach-1,roach-2 --listen-addr=roach-1:26257 --advertise-addr=roach-1:26257 --max-sql-memory=.25 --cache=.25 |
| 23 | + environment: |
| 24 | + - 'ALLOW_EMPTY_PASSWORD=yes' |
| 25 | + - 'COCKROACH_USER=postgres' |
| 26 | + - 'COCKROACH_PASSWORD=postgres' |
| 27 | + - 'COCKROACH_DATABASE=postgres' |
| 28 | + |
| 29 | + roach-2: |
| 30 | + container_name: roach-2 |
| 31 | + hostname: roach-2 |
| 32 | + image: cockroachdb/cockroach-unstable:v23.2.0-beta.1 |
| 33 | + command: start --insecure --join=roach-0,roach-1,roach-2 --listen-addr=roach-2:26257 --advertise-addr=roach-2:26257 --max-sql-memory=.25 --cache=.25 |
| 34 | + environment: |
| 35 | + - 'ALLOW_EMPTY_PASSWORD=yes' |
| 36 | + - 'COCKROACH_USER=postgres' |
| 37 | + - 'COCKROACH_PASSWORD=postgres' |
| 38 | + - 'COCKROACH_DATABASE=postgres' |
| 39 | + |
| 40 | + init: |
| 41 | + container_name: init |
| 42 | + image: cockroachdb/cockroach-unstable:v23.2.0-beta.1 |
| 43 | + command: init --host=roach-0 --insecure |
| 44 | + environment: |
| 45 | + - 'ALLOW_EMPTY_PASSWORD=yes' |
| 46 | + - 'COCKROACH_USER=postgres' |
| 47 | + - 'COCKROACH_PASSWORD=postgres' |
| 48 | + - 'COCKROACH_DATABASE=postgres' |
| 49 | + depends_on: |
| 50 | + - roach-0 |
| 51 | + |
| 52 | + lb: |
| 53 | + container_name: lb |
| 54 | + hostname: lb |
| 55 | + build: cockroachdb/haproxy |
| 56 | + ports: |
| 57 | + - '5432:26000' |
| 58 | + - '8080:8080' |
| 59 | + - '8081:8081' |
| 60 | + depends_on: |
| 61 | + - roach-0 |
| 62 | + - roach-1 |
| 63 | + - roach-2 |
| 64 | + |
| 65 | + client: |
| 66 | + container_name: client |
| 67 | + hostname: client |
| 68 | + image: cockroachdb/cockroach-unstable:v23.2.0-beta.1 |
| 69 | + entrypoint: ['/usr/bin/tail', '-f', '/dev/null'] |
0 commit comments