remove unnecessary code
This commit is contained in:
1 parent
840808daee
commit
3d70814520
2 files changed
+16
-12
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
find "$PUBLIC_DIR" -mindepth 1 \
|
||||
! -name 'index.php' \
|
||||
! -name '.htaccess' \
|
||||
! -name 'storage' \
|
||||
-delete
|
||||
else
|
||||
mkdir -p "$PUBLIC_DIR"
|
||||
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 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
|
||||
Reference in new issue
Block a user