Skip to content

Instantly share code, notes, and snippets.

@simpl1g
Created November 18, 2023 22:11
Show Gist options
  • Save simpl1g/a799d0c7d7e1fe47ac1aaf112ccdfd54 to your computer and use it in GitHub Desktop.
Save simpl1g/a799d0c7d7e1fe47ac1aaf112ccdfd54 to your computer and use it in GitHub Desktop.
Clickhouse docker compose with volume limit
services:
ch_server:
image: clickhouse/clickhouse-server:latest
ports:
- "8123:8123"
- "9000:9000"
volumes:
- ch_data:/var/lib/clickhouse
- type: bind
source: ./settings/users.xml
target: /etc/clickhouse-server/users.d/users.xml
volumes:
ch_data:
driver_opts:
o: "size=900m"
device: tmpfs
type: tmpfs
@simpl1g
Copy link
Author

simpl1g commented Nov 18, 2023

docker-compose up -d
clickhouse-client

SELECT formatReadableSize(free_space)
FROM system.disks

┌─formatReadableSize(free_space)─┐
│ 896.67 MiB                     │
└────────────────────────────────┘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment