#!/bin/bash # dev-setup.sh # Development setup script for MerchantsOfHope.org platform echo "=== Setting up MerchantsOfHope.org Development Environment ===" # Check if Docker is installed if ! command -v docker &> /dev/null; then echo "Error: Docker is not installed. Please install Docker first." exit 1 fi # Check if Docker Compose is installed if ! command -v docker-compose &> /dev/null && ! docker compose version &> /dev/null; then echo "Error: Docker Compose is not installed. Please install Docker Compose first." exit 1 fi # Navigate to project directory cd "$(dirname "$0")" echo "Building and starting containers..." docker compose up --build -d # Wait for services to start echo "Waiting for services to start..." sleep 10 # Check if services are running echo "Checking service status..." docker compose ps echo "Running initial tests..." # Use Docker to run the PHP test suite inside the container docker compose exec php php /var/www/html/test-suite.php echo " === Development Environment Ready === Services: - Web Interface: http://localhost:20001 - PostgreSQL: localhost:5432 - Redis: localhost:6379 Development Features: - Hot reloading enabled (no container restarts needed) - PHP-FPM with Nginx for better performance - Volume mounting for live code updates - Comprehensive test suite included To view logs: docker compose logs -f To stop: docker compose down "