Skip to content

Commit

Permalink
Add instructions for using Docker Compose
Browse files Browse the repository at this point in the history
  • Loading branch information
aronbierbaum committed Mar 2, 2024
1 parent 46482bf commit c8c0e7e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
22 changes: 2 additions & 20 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,11 @@ Create container desired version of ``clickhouse-server``:
docker run --rm -p 127.0.0.1:9000:9000 -p 127.0.0.1:8123:8123 --name test-clickhouse-server clickhouse/clickhouse-server:$VERSION
Create container with the same version of ``clickhouse-client``:
Or run the docker-compose defined in tests folder:

.. code-block:: bash
docker run --rm --entrypoint "/bin/sh" --name test-clickhouse-client --link test-clickhouse-server:clickhouse-server clickhouse/clickhouse-client:$VERSION -c 'while :; do sleep 1; done'
Create ``clickhouse-client`` script on your host machine:

.. code-block:: bash
echo -e '#!/bin/bash\n\ndocker exec test-clickhouse-client clickhouse-client "$@"' | sudo tee /usr/local/bin/clickhouse-client > /dev/null
sudo chmod +x /usr/local/bin/clickhouse-client
After it container ``test-clickhouse-client`` will communicate with
``test-clickhouse-server`` transparently from host machine.

Set ``host=clickhouse-server`` in ``setup.cfg``.

Add entry in hosts file:

.. code-block:: bash
echo '127.0.0.1 clickhouse-server' | sudo tee -a /etc/hosts > /dev/null
cd tests && docker compose up -d
And run tests:

Expand Down
15 changes: 15 additions & 0 deletions tests/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
services:
clickhouse:
image: clickhouse/clickhouse-server:latest
container_name: ClickHouse
ports:
- "8123:8123"
- "9000:9000"
volumes:
- clickhouse-data:/var/lib/clickhouse
- clickhouse-logs:/var/log/clickhouse-server
volumes:
clickhouse-data:
driver: local
clickhouse-logs:
driver: local

0 comments on commit c8c0e7e

Please sign in to comment.