2025-04-25 01:09:44 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# Puffin Offset Calculator Docker Setup Script
|
|
|
|
|
# This script sets up the Docker environment for the Puffin Offset Calculator
|
|
|
|
|
|
|
|
|
|
echo "========================================"
|
|
|
|
|
echo "Puffin Offset Calculator Docker Setup"
|
|
|
|
|
echo "========================================"
|
|
|
|
|
|
|
|
|
|
# Create logs directory if it doesn't exist
|
|
|
|
|
if [ ! -d "logs" ]; then
|
|
|
|
|
echo "Creating logs directory..."
|
|
|
|
|
mkdir -p logs
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# 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; then
|
|
|
|
|
echo "Error: Docker Compose is not installed. Please install Docker Compose first."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2025-04-25 01:49:20 +02:00
|
|
|
echo "Building and starting the Docker container..."
|
|
|
|
|
docker-compose up -d --build
|
2025-04-25 01:09:44 +02:00
|
|
|
|
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
|
echo "========================================"
|
|
|
|
|
echo "Setup completed successfully!"
|
|
|
|
|
echo "Your calculator is now available at: http://localhost:8080"
|
|
|
|
|
echo ""
|
|
|
|
|
echo "Next steps for WordPress integration:"
|
|
|
|
|
echo "1. Copy wordpress-integration.php to your WordPress plugins directory"
|
|
|
|
|
echo "2. Create the required CSS and JS directories as described in README.docker.md"
|
|
|
|
|
echo "3. Activate the plugin in your WordPress admin panel"
|
|
|
|
|
echo "4. Use the [puffin_calculator] shortcode on any page or post"
|
|
|
|
|
echo ""
|
|
|
|
|
echo "For more details, please read the README.docker.md file."
|
|
|
|
|
echo "========================================"
|
|
|
|
|
else
|
|
|
|
|
echo "========================================"
|
|
|
|
|
echo "Error: Failed to start the Docker container."
|
|
|
|
|
echo "Please check the error messages above and try again."
|
|
|
|
|
echo "========================================"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|