From 69449479d0279680d6ba397234bfff88cba2162c Mon Sep 17 00:00:00 2001 From: zeus Date: Fri, 19 Mar 2021 16:17:22 +0200 Subject: [PATCH] create docker-compose mongo replica --- .docker/mongodb/file.key | 15 ++++ .docker/mongodb/initdb.d/usercreate.sh | 9 ++ .docker/mongodb/mongod.conf | 44 ++++++++++ .docker/mongodb/sample.file.key | 15 ++++ .docker/mongodb/scripts/mongosetup.sh | 40 +++++++++ .env | 8 ++ connect.mongo.sh | 10 +++ docker-compose.yml | 116 +++++++++++++++++++++++++ sample.env | 8 ++ 9 files changed, 265 insertions(+) create mode 100755 .docker/mongodb/file.key create mode 100644 .docker/mongodb/initdb.d/usercreate.sh create mode 100644 .docker/mongodb/mongod.conf create mode 100644 .docker/mongodb/sample.file.key create mode 100644 .docker/mongodb/scripts/mongosetup.sh create mode 100644 .env create mode 100644 connect.mongo.sh create mode 100644 docker-compose.yml create mode 100644 sample.env diff --git a/.docker/mongodb/file.key b/.docker/mongodb/file.key new file mode 100755 index 0000000..d665b9c --- /dev/null +++ b/.docker/mongodb/file.key @@ -0,0 +1,15 @@ +wRbjCxlrzEi3VzuR7Xe0/qMkxqRoBDmeUWfraYteInJEKisn7sVB01QtH3CfKTdn +ND8gKg+xzwwK4f7lkLzp9SyQqLWv/IZfBnUR9WZnlb64p9r9/uJpTJo0FUVB/vDD +kAs+bVcgFA1BsdoLMQW7AVycNo0uoLyd2nkM51J1XXqdMI+WAB/Dd3jVL9sY3NfJ +LGn9rNxmgnpUiKRAgob4w+D/V62NJr5q7+EOfR3/5xvkg1Wfn1p+sIJ8NFzZIKMg +MQux+e/F+J4IvXTc8+MdS5tCcZKOu1NVIR5i9i08utgqBKJmzTF5ebfCqoSYOppq +xpoHlzk9yLWus10szBImX4hDtoPyYEHztLW8ol6xsLv9TzNrCG82rP64bZub+hvO +GeyQwoRx52Nf5jWBvoMAOEjYRV4ZE3ghvA8quXAoh6kK9kKyQW5IbhGri87AadKs +++x2HEZHPUYaMnN16DbYY2LHLSyd5MGqbJxHXMBT3JSFS0jLYUjlRHCeHvTta8ud +WnKNdSg/NH7MSUQiWwLP3PVEsqFaP+d0BXzM8JNrawiBgUZZ2yCF4l9KbOib1G+1 +1Xkp0tjXS0K6s31rhZQJvEhTa3+dhH1D8IWRjcQ2axs3DllQ8bqa0hKtI5pndeLT +LK67d3bOyfkB/5UiLnbYgAO6b2CeSvrVpLJf6bH4MPbSTNf8lYXVxPt6p2qOWK9S +Oqb2ahu02TQmWTwLrqRX8Z9EChEbhggnL7I+TxOw3XcF3t3kAH/SPevU8ugNt00e +MIV15q5apokMA35b+z6VhzvcbQI2ypfKnqqdokkr91FlgS/bzWgMudf6JibqcWXA +tbvJjhod7aic8aNwwUMbWC2Mp9f2roWi2SAfQhKzxawFDWCw66XAAlD3LQKr0F+Y +1tAixQZFDDUhB3CRhyY6FAO8rNOCXvA6v16KvA== diff --git a/.docker/mongodb/initdb.d/usercreate.sh b/.docker/mongodb/initdb.d/usercreate.sh new file mode 100644 index 0000000..261e908 --- /dev/null +++ b/.docker/mongodb/initdb.d/usercreate.sh @@ -0,0 +1,9 @@ +set -Eeuo pipefail + +mongo -u "$MONGO_INITDB_ROOT_USERNAME" -p "$MONGO_INITDB_ROOT_PASSWORD" --authenticationDatabase admin "$MONGO_INITDB_DATABASE" < +MONGO_INITDB_ROOT_PASSWORD= +MONGO_INITDB_DATABASE= +MONGO_INITDB_USERNAME= +MONGO_INITDB_PASSWORD= +MONGO_REPLICA_SET_NAME=rs0 \ No newline at end of file