You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.1 KiB

#!/bin/bash
# PoWHD Website Container Management Script
WEB_SERVER="192.168.1.140"
WEB_USER="crappy"
REMOTE_PATH="/home/crappy/ponzi"
PORT="14888"
case "$1" in
"start")
echo "🚀 Starting PoWHD website container..."
ssh $WEB_USER@$WEB_SERVER "cd $REMOTE_PATH && docker-compose up -d"
;;
"stop")
echo "🛑 Stopping PoWHD website container..."
ssh $WEB_USER@$WEB_SERVER "cd $REMOTE_PATH && docker-compose down"
;;
"restart")
echo "🔄 Restarting PoWHD website container..."
ssh $WEB_USER@$WEB_SERVER "cd $REMOTE_PATH && docker-compose restart"
;;
"logs")
echo "📋 Viewing container logs..."
ssh $WEB_USER@$WEB_SERVER "cd $REMOTE_PATH && docker-compose logs -f"
;;
"status")
echo "📊 Container status:"
ssh $WEB_USER@$WEB_SERVER "cd $REMOTE_PATH && docker-compose ps"
;;
"health")
echo "🏥 Testing health check..."
if curl -s http://$WEB_SERVER:$PORT/health | grep -q "healthy"; then
echo "✅ Website is healthy!"
else
echo "❌ Website health check failed"
fi
;;
"update")
echo "🔄 Updating website..."
./deploy.sh
;;
"shell")
echo "🐚 Opening shell in container..."
ssh $WEB_USER@$WEB_SERVER "docker exec -it powhd-analysis-site sh"
;;
*)
echo "PoWHD Website Management"
echo "========================"
echo "Usage: $0 {start|stop|restart|logs|status|health|update|shell}"
echo ""
echo "Commands:"
echo " start - Start the container"
echo " stop - Stop the container"
echo " restart - Restart the container"
echo " logs - View container logs"
echo " status - Show container status"
echo " health - Test health endpoint"
echo " update - Deploy latest changes"
echo " shell - Open shell in container"
echo ""
echo "Current Status:"
ssh $WEB_USER@$WEB_SERVER "cd $REMOTE_PATH && docker-compose ps 2>/dev/null" || echo "Container not found"
;;
esac