From: Kai Moritz Date: Sun, 15 Jan 2023 18:22:23 +0000 (+0100) Subject: feat: Added a MongoDB with the default-testdat to the setup X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=79808e7cc9a044a02b49c79521e4e41948a9cd13;p=demos%2Fkafka%2Fchat feat: Added a MongoDB with the default-testdat to the setup --- diff --git a/0001.sh b/0001.sh new file mode 100644 index 00000000..014a8be7 --- /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 index 00000000..ae150343 --- /dev/null +++ b/chatRoomTo.json @@ -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" +} diff --git a/docker-compose.yml b/docker-compose.yml index 28fca8b5..7034fe5d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: