Files
mamad-app/deploy.sh
2025-06-22 00:01:22 +03:00

43 lines
1.2 KiB
Bash

#!/bin/bash
# Hebrew Soldier App Docker Deployment Script
echo "🚀 Starting Hebrew Soldier App deployment..."
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "❌ Docker is not running. Please start Docker first."
exit 1
fi
# Create config.json if it doesn't exist
if [ ! -f "config.json" ]; then
echo "📝 Creating config.json from template..."
cp config.json.template config.json
echo "⚠️ Please edit config.json with your database settings before continuing."
echo " Press Enter when ready..."
read
fi
# Build and start the application
echo "🔨 Building and starting containers..."
docker-compose up --build -d
# Wait for services to be ready
echo "⏳ Waiting for services to start..."
sleep 10
# Check if services are running
if docker-compose ps | grep -q "Up"; then
echo "✅ Application is running!"
echo "🌐 Access the app at: http://localhost:3000"
echo "📊 Database at: localhost:3306"
echo ""
echo "📋 Useful commands:"
echo " View logs: docker-compose logs -f"
echo " Stop app: docker-compose down"
echo " Restart: docker-compose restart"
else
echo "❌ Something went wrong. Check logs with: docker-compose logs"
fi