init
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
FROM cassandra
|
||||
COPY docker/db/cassandra-init.sh /cassandra-init.sh
|
||||
RUN chmod +x /cassandra-init.sh
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
cat >/import.cql <<EOF
|
||||
CREATE keyspace IF NOT EXISTS ${CASSANDRA_KEYSPACE} with replication = {'class':'SimpleStrategy', 'replication_factor' : 1};
|
||||
USE ${CASSANDRA_KEYSPACE};
|
||||
CREATE TABLE IF NOT EXISTS ${TABLE_NAME}(id TIMEUUID, firstname TEXT, lastname TEXT, birthday date, currentlocation TEXT, userpicture TEXT, certificate TEXT, PRIMARY KEY(id));
|
||||
EOF
|
||||
|
||||
bash -c 'sleep 60; cqlsh -f /import.cql;' &
|
||||
exec /docker-entrypoint.sh "$@";
|
||||
|
||||
Reference in New Issue
Block a user