fix: Gitea Traefik routing and connection pool optimization
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 10m14s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Check for Dependency Changes (push) Failing after 11m25s
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
Some checks failed
🚀 Build & Deploy Image / Determine Build Necessity (push) Failing after 10m14s
🚀 Build & Deploy Image / Build Runtime Base Image (push) Has been skipped
🚀 Build & Deploy Image / Build Docker Image (push) Has been skipped
🚀 Build & Deploy Image / Run Tests & Quality Checks (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Staging (push) Has been skipped
🚀 Build & Deploy Image / Auto-deploy to Production (push) Has been skipped
Security Vulnerability Scan / Check for Dependency Changes (push) Failing after 11m25s
Security Vulnerability Scan / Composer Security Audit (push) Has been cancelled
- Remove middleware reference from Gitea Traefik labels (caused routing issues) - Optimize Gitea connection pool settings (MAX_IDLE_CONNS=30, authentication_timeout=180s) - Add explicit service reference in Traefik labels - Fix intermittent 504 timeouts by improving PostgreSQL connection handling Fixes Gitea unreachability via git.michaelschiemer.de
This commit is contained in:
61
scripts/build/build.sh
Executable file
61
scripts/build/build.sh
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "🚀 Starting Docker build with network resilience..."
|
||||
|
||||
# Prüfe Netzwerk-Konnektivität
|
||||
echo "🔍 Checking network connectivity..."
|
||||
if ! curl -s --connect-timeout 5 https://registry-1.docker.io/v2/ > /dev/null; then
|
||||
echo "⚠️ Docker Hub nicht erreichbar - verwende lokale Images"
|
||||
export DOCKER_BUILDKIT=0
|
||||
export COMPOSE_DOCKER_CLI_BUILD=0
|
||||
fi
|
||||
|
||||
# DNS-Cache leeren
|
||||
echo "🔄 Flushing DNS cache..."
|
||||
sudo systemctl flush-dns 2>/dev/null || sudo systemd-resolve --flush-caches 2>/dev/null || true
|
||||
|
||||
# Docker daemon neu starten falls nötig
|
||||
if ! docker info > /dev/null 2>&1; then
|
||||
echo "🔄 Restarting Docker daemon..."
|
||||
sudo systemctl restart docker
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
# Versuche erst mit Pull
|
||||
echo "📥 Attempting to pull base images..."
|
||||
if timeout 60 docker-compose pull --ignore-pull-failures; then
|
||||
echo "✅ Images pulled successfully"
|
||||
else
|
||||
echo "⚠️ Pull failed - building with local images only"
|
||||
fi
|
||||
|
||||
# Build mit verschiedenen Strategien
|
||||
echo "🏗️ Building containers..."
|
||||
|
||||
# Strategie 1: Normaler Build
|
||||
if timeout 300 docker-compose build --parallel; then
|
||||
echo "✅ Build completed successfully!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "⚠️ Normal build failed - trying fallback strategies..."
|
||||
|
||||
# Strategie 2: Ohne Cache und Pull
|
||||
if timeout 300 docker-compose build --no-cache --pull=false; then
|
||||
echo "✅ Build completed with fallback strategy!"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Strategie 3: Sequenzieller Build
|
||||
echo "🔄 Trying sequential build..."
|
||||
for service in web php db redis queue-worker; do
|
||||
echo "Building $service..."
|
||||
if timeout 300 docker-compose build --no-cache --pull=false "$service"; then
|
||||
echo "✅ $service built successfully"
|
||||
else
|
||||
echo "❌ Failed to build $service"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "🏁 Build process completed"
|
||||
Reference in New Issue
Block a user