Files
project_vollidioten_website/test-docker-setup.sh
Lars Behrends d3d7ec46e6 feat: Add DatabaseManager and LinkPlayer components, implement authentication and linking logic
- Created DatabaseManager component for managing database access via phpMyAdmin.
- Developed LinkPlayer component to link Discord accounts with game characters, including user authentication and error handling.
- Added mock data files for players, organizations, and projects to handle backend unavailability.
- Implemented AuthService for managing user authentication and session checks.
- Created DatabaseService to fetch and manage player, organization, and project data with fallback to mock data.
- Added HTML page for handling authentication unavailability.
- Developed a test script for validating Docker setup and required files.
2025-12-28 16:46:04 +01:00

94 lines
2.4 KiB
Bash

#!/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"
<task_progress>
- [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
</task_progress>
</write_to_file>