#!/bin/bash # Build script for Docker deployment with nginx echo "🏗️ Building Etsy Finance Tracker for production..." # Build the React client echo "📦 Building React client..." cd client npm run build cd .. # Ensure client build directory exists and has correct permissions if [ ! -d "client/dist" ]; then echo "❌ Client build failed - dist directory not found" exit 1 fi echo "📁 Client built successfully in client/dist/" # Build and start with Docker Compose echo "🐳 Starting Docker containers..." docker-compose down docker-compose up --build -d echo "✅ Deployment complete!" echo "🌐 Access your app at: http://localhost:3000" echo "🔍 Health check at: http://localhost:3000/health" echo "📊 View logs with: docker-compose logs -f"