This commit is contained in:
2024-01-17 11:41:47 +03:00
commit c034dbdae0
24 changed files with 1774 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
FROM cassandra
COPY docker/db/cassandra-init.sh /cassandra-init.sh
RUN chmod +x /cassandra-init.sh
+10
View File
@@ -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 "$@";