Merge branch 'develop/cluster-refactoring' of github.com:thingsboard/thingsboard into develop/cluster-refactoring

This commit is contained in:
Andrew Shvayka 2018-05-14 16:48:09 +03:00
commit fc0a2db0c6
3 changed files with 31 additions and 1 deletions

13
Dockerfile.cassandra Normal file
View 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"]

View File

@ -8,6 +8,9 @@ services:
- "2181:2181" - "2181:2181"
cassandra-tb: cassandra-tb:
build:
context: .
dockerfile: Dockerfile.cassandra
image: cassandra image: cassandra
networks: networks:
- core - core
@ -15,7 +18,9 @@ services:
- "7199:7199" - "7199:7199"
- "9160:9160" - "9160:9160"
- "9042:9042" - "9042:9042"
volumes:
- /cassandra:/var/lib/cassandra
- ./db-schema:/docker-entrypoint-initdb.d/
redis: redis:
image: redis:4.0 image: redis:4.0
networks: networks:

View 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 "$@"