chore(docker): .dockerignore angepasst; lokale Build-Schritte in Rebuild-Skripten; Doku/README zu production vs production-prebuilt aktualisiert

This commit is contained in:
2025-10-06 18:59:17 +02:00
parent 7a84130aec
commit 1124b1f40b
24 changed files with 1149 additions and 270 deletions

View File

@@ -20,7 +20,15 @@ echo "[3/7] Pull base images (e.g., caddy)"
sudo docker compose -f "$COMPOSE_FILE" pull || true
echo "[4/7] Build application image without cache"
# Falls docker-compose-prod.yml den target 'production-prebuilt' nutzt, vorher lokal bauen
if grep -q "target:\s*production-prebuilt" "$COMPOSE_FILE" 2>/dev/null; then
echo "Detected target production-prebuilt in $COMPOSE_FILE - building locally first..."
pnpm install --frozen-lockfile --prod || exit 1
pnpm run build || exit 1
fi
sudo docker compose -f "$COMPOSE_FILE" build --no-cache
echo "Build completed successfully. Native modules compiled for Alpine Linux."
echo "[5/7] Start services in background"
sudo docker compose -f "$COMPOSE_FILE" up -d
@@ -54,6 +62,9 @@ for i in {1..12}; do
sleep 5
done
echo "[6c/7] Verifying bcrypt installation in production container..."
sudo docker compose -f "$COMPOSE_FILE" exec stargirlnails node -e "require('bcrypt')" && echo "✓ bcrypt OK" || echo "✗ bcrypt FAILED"
echo "[7/7] Tail recent logs for app and caddy (press Ctrl+C to exit)"
sudo docker compose -f "$COMPOSE_FILE" logs --since=10m -f stargirlnails &
APP_LOG_PID=$!