Merge branch 'develop/cluster-refactoring' of github.com:thingsboard/thingsboard into develop/cluster-refactoring
This commit is contained in:
commit
fc0a2db0c6
13
Dockerfile.cassandra
Normal file
13
Dockerfile.cassandra
Normal file
@ -0,0 +1,13 @@
|
||||
FROM cassandra
|
||||
|
||||
WORKDIR /opt/cassandra
|
||||
|
||||
COPY dao/src/main/resources/cassandra/schema.cql /opt/cassandra
|
||||
|
||||
COPY entrypoint-with-db-init.sh /opt/cassandra/entrypoint-with-db-init.sh
|
||||
|
||||
RUN chmod +x /opt/cassandra/entrypoint-with-db-init.sh
|
||||
|
||||
ENTRYPOINT ["/opt/cassandra/entrypoint-with-db-init.sh"]
|
||||
|
||||
CMD ["cassandra", "-f"]
|
||||
@ -8,6 +8,9 @@ services:
|
||||
- "2181:2181"
|
||||
|
||||
cassandra-tb:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.cassandra
|
||||
image: cassandra
|
||||
networks:
|
||||
- core
|
||||
@ -15,7 +18,9 @@ services:
|
||||
- "7199:7199"
|
||||
- "9160:9160"
|
||||
- "9042:9042"
|
||||
|
||||
volumes:
|
||||
- /cassandra:/var/lib/cassandra
|
||||
- ./db-schema:/docker-entrypoint-initdb.d/
|
||||
redis:
|
||||
image: redis:4.0
|
||||
networks:
|
||||
|
||||
12
entrypoint-with-db-init.sh
Normal file
12
entrypoint-with-db-init.sh
Normal file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $1 = 'cassandra' ]]; then
|
||||
|
||||
until cqlsh -f/opt/cassandra/schema.cql; do
|
||||
echo "cqlsh: Cassandra is unavailable - retrying"
|
||||
sleep 2
|
||||
done &
|
||||
|
||||
fi
|
||||
|
||||
exec /docker-entrypoint.sh "$@"
|
||||
Loading…
x
Reference in New Issue
Block a user