remove unnecessary code

This commit is contained in:
Giovanni committed 2026-10-03 22:24:13 +02:00
1 parent 840808daee
commit 3d70814520
2 files changed
+13 -9

No files matched your search

+1
View File
@@ -63,6 +63,7 @@ services:
- VITE_ENABLED_TRANSPORTS=${VITE_ENABLED_TRANSPORTS}
volumes:
- .:/var/www/app${DEV:+:delegated}
- /var/www/app/apps/frontend/node_modules
depends_on:
php:
condition: service_healthy
+12 -9
View File
@@ -5,32 +5,36 @@ APP_DIR=/var/www/app
FRONTEND_DIR="$APP_DIR/apps/frontend"
BACKEND_DIR="$APP_DIR/apps/backend"
PUBLIC_DIR="$BACKEND_DIR/public"
PHP_HOST="php"
PHP_PORT=9000
cd "$FRONTEND_DIR"
echo "[FRONTEND BUILD] Installation des dépendances npm..."
npm install --prefer-offline --no-audit
echo "[FRONTEND BUILD] Compilation Vite/React..."
npm run build
if [ -d "$PUBLIC_DIR" ]; then
if [ ! -d "dist" ]; then
echo "❌ Erreur: Le dossier 'dist' n'a pas été généré par Vite."
exit 1
fi
mkdir -p "$PUBLIC_DIR"
# Nettoyage sécurisé
find "$PUBLIC_DIR" -mindepth 1 \
! -name 'index.php' \
! -name '.htaccess' \
! -name 'storage' \
-delete
else
mkdir -p "$PUBLIC_DIR"
fi
-delete 2>/dev/null || true
echo "[FRONTEND BUILD] Copie vers $PUBLIC_DIR..."
cp -r dist/* "$PUBLIC_DIR/"
if [ -f "$PUBLIC_DIR/index.html" ]; then
mkdir -p "$BACKEND_DIR/resources/views"
cp "$PUBLIC_DIR/index.html" "$BACKEND_DIR/resources/views/app.blade.php"
rm "$PUBLIC_DIR/index.html"
rm -f "$PUBLIC_DIR/index.html"
fi
if [ ! -L "$PUBLIC_DIR/storage" ] && [ ! -e "$PUBLIC_DIR/storage" ]; then
@@ -38,5 +42,4 @@ if [ ! -L "$PUBLIC_DIR/storage" ] && [ ! -e "$PUBLIC_DIR/storage" ]; then
fi
echo "[FRONTEND BUILD] Build React terminé et déployé dans $PUBLIC_DIR ✅"
exit 0