-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·37 lines (30 loc) · 1.06 KB
/
run.sh
File metadata and controls
executable file
·37 lines (30 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
set -euo pipefail
# Load environment variables from .env if present
if [ -f .env ]; then
set -a
source .env
set +a
fi
MONGO_CONTAINER_NAME="inboxpilot-mongo"
MONGO_IMAGE="mongo:7"
if ! docker info >/dev/null 2>&1; then
echo "Docker is required to start MongoDB. Please start Docker Desktop and retry."
exit 1
fi
if docker ps --format '{{.Names}}' | grep -q "^${MONGO_CONTAINER_NAME}$"; then
echo "MongoDB container ${MONGO_CONTAINER_NAME} is already running"
elif docker ps -a --format '{{.Names}}' | grep -q "^${MONGO_CONTAINER_NAME}$"; then
echo "Starting existing MongoDB container ${MONGO_CONTAINER_NAME}"
docker start "${MONGO_CONTAINER_NAME}" >/dev/null
else
echo "Creating and starting MongoDB container ${MONGO_CONTAINER_NAME}"
docker run -d --name "${MONGO_CONTAINER_NAME}" -p 27017:27017 "${MONGO_IMAGE}" >/dev/null
fi
export MONGODB_URI="${MONGODB_URI:-mongodb://localhost:27017}"
if [ ! -d ".venv" ]; then
python3 -m venv .venv
fi
. .venv/bin/activate
pip install -r Platform/requirements.txt
python Platform/platform_service.py