feat: Added a MongoDB with the default-testdat to the setup
authorKai Moritz <kai@juplo.de>
Sun, 15 Jan 2023 18:22:23 +0000 (19:22 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 15 Jan 2023 18:22:23 +0000 (19:22 +0100)
0001.sh [new file with mode: 0644]
chatRoomTo.json [new file with mode: 0644]
docker-compose.yml

diff --git a/0001.sh b/0001.sh
new file mode 100644 (file)
index 0000000..014a8be
--- /dev/null
+++ b/0001.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+mongoimport --collection=chatRoomTo --db=test /docker-entrypoint-initdb.d/chatRoomTo.json
diff --git a/chatRoomTo.json b/chatRoomTo.json
new file mode 100644 (file)
index 0000000..ae15034
--- /dev/null
@@ -0,0 +1,31 @@
+{
+  "_id": "5c73531c-6fc4-426c-adcb-afc5c140a0f7",
+  "name": "FOO",
+  "messages": [
+    {
+      "_id": "peter--1",
+      "serial": 0,
+      "time": "2023-01-13T20:43:16.803382151",
+      "text": "Hallo, ich heiße Peter!"
+    },
+    {
+      "_id": "ute--1",
+      "serial": 1,
+      "time": "2023-01-13T20:43:16.804049969",
+      "text": "Ich bin Ute..."
+    },
+    {
+      "_id": "peter--2",
+      "serial": 2,
+      "time": "2023-01-13T20:43:16.804092782",
+      "text": "Willst du mit mir gehen?"
+    },
+    {
+      "_id": "klaus--1",
+      "serial": 3,
+      "time": "2023-01-13T20:43:16.804122604",
+      "text": "Ja? Nein? Vielleicht??"
+    }
+  ],
+  "_class": "de.juplo.kafka.chat.backend.persistence.storage.mongodb.ChatRoomTo"
+}
index 28fca8b..7034fe5 100644 (file)
@@ -84,6 +84,14 @@ services:
     depends_on:
       - kafka-0
 
+  mongo:
+    image: mongo:4.4.13
+    volumes:
+      - ./0001.sh:/docker-entrypoint-initdb.d/0001.sh:ro
+      - ./chatRoomTo.json:/docker-entrypoint-initdb.d/chatRoomTo.json:ro
+    ports:
+      - 27017:27017
+
   haproxy:
     image: haproxy:2.7
     volumes: