#!/bin/bash # Server Deployment Script set -e echo "🚀 Deploying Browser Tab Manager on Server..." # Ensure we're in the right directory if [ ! -f "Dockerfile" ]; then echo "❌ Error: Dockerfile not found. Are you in the right directory?" exit 1 fi # Create web/manifest.json if missing mkdir -p web if [ ! -f "web/manifest.json" ]; then cat > web/manifest.json << 'EOF' { "name": "Browser Tab Manager", "short_name": "TabManager", "start_url": ".", "display": "standalone", "background_color": "#0175C2", "theme_color": "#0175C2", "description": "Manage browser tabs in a grid view", "orientation": "portrait-primary", "prefer_related_applications": false } EOF fi echo "✅ Project structure ready" # Build the container echo "🔨 Building Podman container..." podman build -t browser-tab-manager . # Stop and remove existing container if running podman stop browser-tab-manager 2>/dev/null || true podman rm browser-tab-manager 2>/dev/null || true # Run the container on port 8081 echo "🚢 Starting container..." podman run -d \ --name browser-tab-manager \ -p 8081:80 \ --restart unless-stopped \ browser-tab-manager echo "✅ Container started successfully!" echo "" echo "🌐 Your Browser Tab Manager is now running at:" SERVER_IP=$(hostname -I | awk '{print $1}' 2>/dev/null || echo "your-server-ip") echo " http://${SERVER_IP}:8081" echo "" echo "📝 Useful commands:" echo " View logs: podman logs -f browser-tab-manager" echo " Stop: podman stop browser-tab-manager" echo " Start: podman start browser-tab-manager" echo " Restart: podman restart browser-tab-manager" echo " Remove: podman rm -f browser-tab-manager"