Go to file
Admin 415319db81 update response 2025-12-19 10:27:50 +07:00
app update response 2025-12-19 10:27:50 +07:00
configs first commit 2025-12-19 09:58:58 +07:00
services first commit 2025-12-19 09:19:51 +07:00
.gitignore first commit 2025-12-19 09:18:57 +07:00
Dockerfile first commit 2025-12-19 09:17:39 +07:00
README.md update response 2025-12-19 10:27:50 +07:00
docker-compose.yml first commit 2025-12-19 09:17:39 +07:00
requirements.txt first commit 2025-12-19 09:17:39 +07:00

README.md

uvicorn app.main:app --workers 1

nohup ./venv/bin/python -m uvicorn app.main:app
--port 8000
--workers 1 \

health-agent.log 2>&1 &

ps aux | grep uvicorn

#!/usr/bin/env bash APP_DIR="/home/devops/projects/healthy-checker" LOG_FILE="$APP_DIR/health-agent.log" PYTHON="$APP_DIR/venv/bin/python" PORT=8000

echo "Restarting Health Agent..."

cd "$APP_DIR" || exit 1

Kill uvicorn process đang chạy

PIDS=$(ps aux | grep "[u]vicorn app.main:app" | awk '{print $2}')

if [ -n "$PIDS" ]; then echo "Stopping running process: $PIDS" kill $PIDS sleep 2 fi

Start lại bằng nohup

echo "Starting Health Agent..." nohup "$PYTHON" -m uvicorn app.main:app
--port $PORT
--workers 1 \

"$LOG_FILE" 2>&1 &

sleep 1

Verify

NEW_PID=$(ps aux | grep "[u]vicorn app.main:app" | awk '{print $2}')

if [ -n "$NEW_PID" ]; then echo "Health Agent started (PID: $NEW_PID)" else echo "Failed to start Health Agent" fi