forked from duoshuo/php-cassandra
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
41 lines (40 loc) · 1.23 KB
/
Copy pathdocker-compose.yml
File metadata and controls
41 lines (40 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: php-cassandra
services:
cassandra:
image: cassandra:${CASSANDRA_VERSION:-5.0}
container_name: php-cassandra-test-db
ports:
- "9142:9042"
# Enable user-defined functions/aggregates, materialized views and SASI
# indexes, which are off by default. Cassandra 4.0 and 4.1+ spell these
# settings differently, so toggle whichever name is present.
command:
- bash
- -c
- |
conf=/etc/cassandra/cassandra.yaml
for setting in user_defined_functions materialized_views sasi_indexes; do
sed -i -E "s/^[# ]*(enable_$${setting}|$${setting}_enabled) *: *false/\1: true/" "$$conf"
done
exec docker-entrypoint.sh cassandra -f
environment:
- CASSANDRA_START_RPC=false
- CASSANDRA_ENDPOINT_SNITCH=GossipingPropertyFileSnitch
- CASSANDRA_DC=dc1
- CASSANDRA_RACK=rack1
- MAX_HEAP_SIZE=512M
- HEAP_NEWSIZE=128M
healthcheck:
test: ["CMD", "bash", "-lc", "/opt/cassandra/bin/cqlsh -e 'DESCRIBE KEYSPACES' 127.0.0.1 9042"]
interval: 10s
timeout: 5s
retries: 30
ulimits:
memlock:
soft: -1
hard: -1
networks:
- php_cassandra_net
networks:
php_cassandra_net:
driver: bridge