Files
drone-detector/test-docker-builds.sh
2025-08-17 05:02:19 +02:00

62 lines
1.3 KiB
Bash

#!/bin/bash
# Docker Build Test Script
# Tests building individual containers before running docker compose
set -e
echo "🐳 Testing Docker Builds"
echo "======================="
# Colors
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m'
print_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
print_info() {
echo -e "${YELLOW}[INFO]${NC} $1"
}
# Test backend build
print_info "Building backend container..."
if docker build -t drone-backend ./server; then
print_success "Backend build completed"
else
print_error "Backend build failed"
exit 1
fi
# Test frontend build
print_info "Building frontend container..."
if docker build -t drone-frontend ./client; then
print_success "Frontend build completed"
else
print_error "Frontend build failed"
exit 1
fi
# Test simulator build
print_info "Building simulator container..."
if docker build -f docker/simulator/Dockerfile -t drone-simulator .; then
print_success "Simulator build completed"
else
print_error "Simulator build failed"
exit 1
fi
print_success "All builds completed successfully!"
echo ""
echo "You can now run:"
echo " docker compose up -d"
echo " or"
echo " docker compose -f docker compose.simple.yml up -d"