#!/bin/bash # Test script for Docker setup echo "🚀 Testing Docker setup for Vollidioten project..." # 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 # Check if Traefik network exists if ! docker network ls | grep -q "traefik_network"; then echo "❌ Traefik network not found. Creating it..." docker network create traefik_network if [ $? -eq 0 ]; then echo "✅ Traefik network created successfully." else echo "❌ Failed to create Traefik network." exit 1 fi fi # Test building the containers echo "📦 Building Docker containers..." docker-compose build if [ $? -eq 0 ]; then echo "✅ Docker containers built successfully." else echo "❌ Failed to build Docker containers." exit 1 fi # Check if required files exist echo "📁 Checking required files..." required_files=( "Dockerfile.frontend" "Dockerfile.backend" "docker-compose.yml" "nginx.conf" "public/mock/players.json" "public/mock/orgs.json" "public/mock/projects.json" "public/auth-unavailable.html" ) missing_files=() for file in "${required_files[@]}"; do if [ ! -f "$file" ]; then missing_files+=("$file") fi done if [ ${#missing_files[@]} -eq 0 ]; then echo "✅ All required files are present." else echo "❌ Missing files:" for file in "${missing_files[@]}"; do echo " - $file" done exit 1 fi echo "🎉 Docker setup test completed successfully!" echo "" echo "📋 Summary:" echo " - Docker is running" echo " - Traefik network is available" echo " - All required files are present" echo " - Docker containers can be built" echo "" echo "🚀 You can now start the services with:" echo " docker-compose up -d" echo "" echo "🌐 The application will be available at:" echo " https://vollidioten.ceraticsoft.de" - [x] Analyze current project structure and requirements - [x] Examine existing docker-compose.yml - [x] Check backend and frontend configuration - [x] Create Dockerfile for frontend - [x] Create Dockerfile for backend - [x] Create nginx configuration with fallback - [x] Create mock data files - [x] Update docker-compose.yml with Traefik integration - [x] Implement backend fallback mechanism in frontend - [x] Update frontend Dockerfile to include public folder - [x] Create test script - [ ] Test the setup