mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-07-29 14:12:06 +00:00
safer docker stop + ordered start of backend container before the others
This commit is contained in:
parent
8607514c05
commit
b70fcf5d71
@ -63,17 +63,39 @@ if [ ! -f "docker-compose.yml" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# start docker compose for searxng, redis, frontend services
|
# Stop only containers in our project's network
|
||||||
echo "Warning: stopping all docker containers (t-4 seconds)..."
|
echo "Stopping project containers..."
|
||||||
sleep 4
|
$COMPOSE_CMD down
|
||||||
docker stop $(docker ps -a -q)
|
|
||||||
echo "All containers stopped"
|
|
||||||
|
|
||||||
|
# First start python-env and wait for it to be healthy
|
||||||
|
echo "Starting python-env service..."
|
||||||
|
if ! $COMPOSE_CMD up -d python-env; then
|
||||||
|
echo "Error: Failed to start python-env container."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Wait for python-env to be healthy (check if it's running and not restarting)
|
||||||
|
echo "Waiting for python-env to be ready..."
|
||||||
|
for i in {1..30}; do
|
||||||
|
if [ "$(docker inspect -f '{{.State.Running}}' python-env)" = "true" ] && \
|
||||||
|
[ "$(docker inspect -f '{{.State.Restarting}}' python-env)" = "false" ]; then
|
||||||
|
echo "python-env is ready!"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
if [ $i -eq 30 ]; then
|
||||||
|
echo "Error: python-env failed to start properly after 30 seconds"
|
||||||
|
$COMPOSE_CMD logs python-env
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
# Now start the rest of the services
|
||||||
|
echo "Starting remaining services..."
|
||||||
if ! $COMPOSE_CMD up; then
|
if ! $COMPOSE_CMD up; then
|
||||||
echo "Error: Failed to start containers. Check Docker logs with '$COMPOSE_CMD logs'."
|
echo "Error: Failed to start containers. Check Docker logs with '$COMPOSE_CMD logs'."
|
||||||
echo "Possible fixes: Run with sudo or ensure port 8080 is free."
|
echo "Possible fixes: Run with sudo or ensure port 8080 is free."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
sleep 10
|
sleep 10
|
Loading…
x
Reference in New Issue
Block a user