forked from freeleaps/freeleaps-pub
Update for support bash 3 and make component access local mongodb with environment parameter
This commit is contained in:
parent
a711c42483
commit
bf5138c3b2
@ -1,5 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
# This script was generated by bashly 1.2.7 (https://bashly.dannyb.co)
|
||||
# Modifying it manually is not recommended
|
||||
|
||||
# :wrapper.bash3_bouncer
|
||||
@ -691,7 +690,7 @@ start_local_mongodb() {
|
||||
echo "==> Starting MongoDB service..."
|
||||
echo "Step 3. [INFO] Starting MongoDB container..."
|
||||
|
||||
MONGO_CONTAINER_NAME="freeleaps2-mongo"
|
||||
MONGO_CONTAINER_NAME="freeleaps2-mongodb"
|
||||
MONGO_IMAGE="mongo:latest"
|
||||
|
||||
# if a container with the same name exists, remove it
|
||||
@ -1072,6 +1071,13 @@ devbox_init_command() {
|
||||
echo "==> [INIT] Starting Freeleaps services... $USE_LOCAL_COMPONENT"
|
||||
|
||||
if [[ "$(lower "$USE_LOCAL_COMPONENT")" == "true" ]]; then
|
||||
# 3.Create and start MongoDB container
|
||||
echo "Step 3. [INFO] Starting MongoDB container..."
|
||||
|
||||
start_local_mongodb
|
||||
|
||||
# 4. Pull and start RabbitMQ container
|
||||
start_local_rabbitMQ
|
||||
echo ' ===> Using local components for Freeleaps services.'
|
||||
|
||||
# Local components for Freeleaps services (devsvc, payment, content, central_storage, authentication)
|
||||
@ -1122,6 +1128,8 @@ if [[ "$(lower "$USE_LOCAL_COMPONENT")" == "true" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
DEFAULT_IP=$(docker network inspect bridge | grep -m1 '"Gateway":' | sed -E 's/.*"Gateway": "([^"]+)".*/\1/')
|
||||
echo "Default gateway IP: $DEFAULT_IP"
|
||||
|
||||
port=$(get_port $component)
|
||||
echo "==> Creating and starting ${component} container... ${port}"
|
||||
@ -1134,6 +1142,7 @@ if [[ "$(lower "$USE_LOCAL_COMPONENT")" == "true" ]]; then
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-e SERVICE_API_ACCESS_PORT=${port} \
|
||||
-e SERVICE_API_ACCESS_HOST=0.0.0.0 \
|
||||
-e MONGODB_URI="mongodb://$DEFAULT_IP:27017" \
|
||||
"$component_full_image" \
|
||||
uvicorn webapi.main:app --reload --port ${port} --host 0.0.0.0 2>/dev/null
|
||||
)"
|
||||
@ -1147,13 +1156,7 @@ if [[ "$(lower "$USE_LOCAL_COMPONENT")" == "true" ]]; then
|
||||
done
|
||||
|
||||
|
||||
# 3.Create and start MongoDB container
|
||||
echo "Step 3. [INFO] Starting MongoDB container..."
|
||||
|
||||
start_local_mongodb
|
||||
|
||||
# 4. Pull and start RabbitMQ container
|
||||
start_local_rabbitMQ
|
||||
|
||||
else
|
||||
echo '============================================'
|
||||
echo ' ===> Using online components for Freeleaps services.'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user