Files
kidsai/start.sh
mindesbunister b31492a354 Complete Docker migration with Next.js 15 and cleaned design
- Migrated from Express.js to Next.js 15 with TypeScript
- Added Docker Compose v2 with multi-stage builds
- Implemented Docker Bake support for improved builds
- Created professional component structure with Tailwind CSS
- Added enhanced visual design with glass morphism effects
- Improved responsive layout and better UX flow
- Updated all dependencies and configurations
- Added proper TypeScript types and modern practices
- Created development scripts for easy container management
- Cleaned up excessive animations for better user experience
2025-07-14 10:11:06 +02:00

66 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
# KidsAI Explorer - Docker Startup Script
# This script helps you get started with the containerized Next.js application
set -e
echo "🚀 KidsAI Explorer - Docker Setup"
echo "=================================="
# Check if Docker is running
if ! docker info >/dev/null 2>&1; then
echo "❌ Error: Docker is not running. Please start Docker first."
exit 1
fi
# Check if .env file exists
if [ ! -f .env ]; then
echo "📝 Creating .env file from template..."
cp .env.example .env
echo "⚠️ Please edit .env file and add your API keys before continuing."
echo " You can get OpenAI API key from: https://platform.openai.com/api-keys"
echo ""
echo "Would you like to continue with the default setup? (y/n)"
read -r response
if [[ ! "$response" =~ ^[Yy]$ ]]; then
echo "Please edit .env and run this script again."
exit 1
fi
fi
echo ""
echo "🐳 Building and starting KidsAI Explorer..."
echo ""
# Build and start the containers
docker compose down --remove-orphans 2>/dev/null || true
docker compose up --build -d
echo ""
echo "📦 Waiting for the application to start..."
sleep 10
# Check if the container is running
if docker compose ps | grep -q "Up"; then
echo ""
echo "✅ KidsAI Explorer is now running!"
echo ""
echo "🌐 Access the application at: http://localhost:3000"
echo ""
echo "📋 Useful commands:"
echo " View logs: docker compose logs -f"
echo " Stop app: docker compose down"
echo " Restart: docker compose restart"
echo " Rebuild: docker compose up --build"
echo ""
echo "🔧 For development:"
echo " Enter container: docker compose exec app sh"
echo " View processes: docker compose ps"
echo ""
else
echo "❌ Error: Application failed to start."
echo "View logs with: docker compose logs"
exit 1
fi