mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-04-16 05:45:48 -05:00
18 lines
396 B
Bash
Executable File
18 lines
396 B
Bash
Executable File
#! /bin/sh
|
|
|
|
set -eu
|
|
|
|
git_base=$(git rev-parse --show-toplevel)
|
|
mongodb_init_script=$(cat "$git_base/config/mongodb-init.js")
|
|
|
|
docker compose up -d mongodb
|
|
|
|
while ! docker compose exec mongodb mongosh --eval "db.adminCommand('ping')"; do
|
|
echo "Waiting for mongodb to be ready..."
|
|
sleep 1
|
|
done
|
|
|
|
docker compose exec mongodb mongosh --eval "$mongodb_init_script"
|
|
|
|
docker compose down mongodb
|