local-redpanda-cluster/docker-compose.yml

112 lines
3.1 KiB
YAML

services:
rp1:
image: docker.redpanda.com/vectorized/redpanda:v22.2.2
restart: on-failure:10
ports:
- 9092:9092
command:
- redpanda start
- --smp 1
- --memory 1G
- --reserve-memory 0M
- --overprovisioned
- --node-id 0
- --check=false
- --pandaproxy-addr PLAINTEXT://0.0.0.0:28082,OUTSIDE://0.0.0.0:8082
- --advertise-pandaproxy-addr PLAINTEXT://rp1:28082,OUTSIDE://rp1:8082
- --kafka-addr PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092
- --advertise-kafka-addr PLAINTEXT://rp1:29092,OUTSIDE://rp1:9092
- --rpc-addr 0.0.0.0:33145
- --advertise-rpc-addr rp1:33145
volumes:
- rp1data:/var/lib/redpanda/data
healthcheck:
test: [ "CMD", "rpk", "cluster", "health" ]
interval: 30s
timeout: 5s
retries: 3
start_period: 60s
rp2:
image: docker.redpanda.com/vectorized/redpanda:v22.2.2
restart: on-failure:10
ports:
- 9093:9092
command:
- redpanda start
- --smp 1
- --memory 1G
- --reserve-memory 0M
- --overprovisioned
- --node-id 1
- --check=false
- --pandaproxy-addr PLAINTEXT://0.0.0.0:28082,OUTSIDE://0.0.0.0:8082
- --advertise-pandaproxy-addr PLAINTEXT://rp2:28082,OUTSIDE://rp2:8082
- --kafka-addr PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092
- --advertise-kafka-addr PLAINTEXT://rp2:29092,OUTSIDE://rp2:9092
- --rpc-addr 0.0.0.0:33145
- --advertise-rpc-addr rp2:33145
- --seeds rp1:33145
volumes:
- rp2data:/var/lib/redpanda/data
healthcheck:
test: [ "CMD", "rpk", "cluster", "health" ]
interval: 30s
timeout: 5s
retries: 3
start_period: 60s
depends_on:
rp1:
condition: service_healthy
rp3:
image: docker.redpanda.com/vectorized/redpanda:v22.2.2
restart: on-failure:10
ports:
- 9094:9092
command:
- redpanda start
- --smp 1
- --memory 1G
- --reserve-memory 0M
- --overprovisioned
- --node-id 2
- --check=false
- --pandaproxy-addr PLAINTEXT://0.0.0.0:28082,OUTSIDE://0.0.0.0:8082
- --advertise-pandaproxy-addr PLAINTEXT://rp3:28082,OUTSIDE://rp3:8082
- --kafka-addr PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092
- --advertise-kafka-addr PLAINTEXT://rp3:29092,OUTSIDE://rp3:9092
- --rpc-addr 0.0.0.0:33145
- --advertise-rpc-addr rp3:33145
- --seeds rp1:33145,rp2:33145
volumes:
- rp3data:/var/lib/redpanda/data
healthcheck:
test: [ "CMD", "rpk", "cluster", "health" ]
interval: 30s
timeout: 5s
retries: 3
start_period: 60s
depends_on:
rp1:
condition: service_healthy
# This is for viewing the Redpanda topics and the contents within it.
kafka-console:
image: docker.redpanda.com/vectorized/console:latest
environment:
KAFKA_BROKERS: rp1:9092,rp2:9092,rp3:9092
ports:
- 8080:8080
depends_on:
rp1:
condition: service_healthy
rp2:
condition: service_healthy
rp3:
condition: service_healthy
volumes:
rp1data:
rp2data:
rp3data: