Skip to content

Add Docker Compose Quickstart #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jun 2, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions bufstream/quickstart/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
![The Buf logo](https://raw.githubusercontent.com/bufbuild/buf-examples/main/.github/buf-logo.svg)

# Bufstream quickstart

This directory contains example code for Bufstream's basic quickstart.

It set up a minio for S3 storage and a postgres instance that bufstream connects to,
plus akhq for easy of exploration.

Simply run:

```
$ docker compose up
```

And once AKHQ is ready, navigate to http://localhost:8080/ to create and explore topics.

You can also access:

* minio's admin interface at http://localhost:9001/
* bufstream connect endpoint at http://localhost:8089/
* bufstream kafka endpoint at http://localhost:9092/

[docs]: https://buf.build/docs/bufstream/quickstart/
15 changes: 15 additions & 0 deletions bufstream/quickstart/bufstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
auto_migrate_metadata_storage: true
cluster: bufstream
zone: localhost
storage:
provider: S3
region: us-east-1
bucket: bufstream
endpoint: http://minio:9000
access_key_id:
string: admin
secret_access_key:
string: password
postgres:
dsn:
string: postgres://root:nonsensepassword@postgres:5432/bufstream
152 changes: 152 additions & 0 deletions bufstream/quickstart/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
services:
postgres:
image: postgres
container_name: postgres
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=nonsensepassword
- POSTGRES_DB=bufstream
networks:
bufstream:
healthcheck:
test:
- CMD
- pg_isready
- -d
- bufstream
interval: 30s
timeout: 60s
retries: 5
start_period: 15s
volumes:
- pgData:/var/lib/postgresql/data

minio:
image: minio/minio
container_name: minio
environment:
- MINIO_ROOT_USER=admin
- MINIO_ROOT_PASSWORD=password
- MINIO_DOMAIN=minio
networks:
bufstream:
aliases:
- bufstream.minio
ports:
- 9000:9000
- 9001:9001
healthcheck:
test:
- CMD
- curl
- --silent
- --fail
- --output
- /dev/null
- http://localhost:9000/minio/health/live
start_period: 15s
interval: 5s
timeout: 10s
retries: 10
command:
- server
- /data
- --console-address
- :9001

mc:
image: minio/mc
container_name: mc
environment:
- AWS_ACCESS_KEY_ID=admin
- AWS_SECRET_ACCESS_KEY=password
- AWS_REGION=us-east-1
networks:
bufstream:
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
until (/usr/bin/mc alias set minio http://minio:9000 admin password) do echo '...waiting...' && sleep 1; done;
/usr/bin/mc mb minio/bufstream;
/usr/bin/mc anonymous set public minio/bufstream;
tail -f /dev/null
"

bufstream:
image: bufbuild/bufstream:0.3.27
hostname: bufstream
container_name: bufstream
depends_on:
minio:
condition: service_healthy
postgres:
condition: service_healthy
environment:
- BUFSTREAM_KAFKA_HOST=bufstream
- BUFSTREAM_KAFKA_PUBLIC_HOST=bufstream
networks:
bufstream:
ports:
- 9089:9089
- 9092:9092
# Edit bufstream.yaml within this repository to change configuration.
volumes:
- ./bufstream.yaml:/bufstream.yaml
healthcheck:
test:
- CMD
- /usr/local/bin/bufstream
- admin
- status
- --exit-code
- --url
- http://127.0.0.1:9089
start_period: 15s
interval: 5s
timeout: 10s
retries: 10
command:
- serve
- --config
- /bufstream.yaml

akhq:
image: tchiotludo/akhq:0.25.0
container_name: akhq
stop_signal: SIGKILL
networks:
bufstream:
ports:
- 8080:8080
depends_on:
bufstream:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- --silent
- --fail
- --output
- /dev/null
- http://localhost:28081/health
start_period: 15s
interval: 5s
timeout: 10s
retries: 10
environment:
AKHQ_CONFIGURATION: |
akhq:
connections:
bufstream-local:
properties:
bootstrap.servers: "bufstream:9092"
client.id: "akhq;broker_count=1;host_override=bufstream"

networks:
bufstream:

volumes:
pgData:
Loading