Skip to content

Instantly share code, notes, and snippets.

@HeCorr
Created January 26, 2025 13:09
Show Gist options
  • Save HeCorr/786a7258496c033a7949b9e42ebd3985 to your computer and use it in GitHub Desktop.
Save HeCorr/786a7258496c033a7949b9e42ebd3985 to your computer and use it in GitHub Desktop.
a Docker Compose file for YugabyteDB that actually fucking works.
# To open SQL shell:
# docker exec -it yugabyte bash -c '/home/yugabyte/bin/ysqlsh -e -h $(hostname) -P null="(NULL)"'
services:
yugabyte:
image: yugabytedb/yugabyte:latest
container_name: yugabyte
restart: unless-stopped
command: bash -c 'bin/yugabyted start --advertise_address="$$(hostname -i)" --background=false'
# ^^^ required to prevent network binding errors if container's ip changes
ports:
- 5433:5433
- 7000:7000
- 9000:9000
volumes:
- yugabyte_vol:/root/var/
networks:
- yugabyte_net
volumes:
yugabyte_vol:
networks:
yugabyte_net:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment