forked from ctangarife/pentest-ia
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild-frontend.sh
More file actions
25 lines (19 loc) · 892 Bytes
/
Copy pathbuild-frontend.sh
File metadata and controls
25 lines (19 loc) · 892 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
echo "🚀 Generando build del frontend desde el contenedor..."
# Verificar que el contenedor esté ejecutándose
if ! docker ps | grep -q pentestia-ui; then
echo "❌ El contenedor pentestia-ui no está ejecutándose"
echo "💡 Ejecuta: docker compose up -d pentestia-ui"
exit 1
fi
# Crear directorio static si no existe
mkdir -p data/static
# Ejecutar build dentro del contenedor
echo "🔨 Generando build de producción desde el contenedor..."
docker exec pentestia-ui sh -c "cd /app && npm run build"
# Copiar archivos buildados desde el contenedor
echo "📁 Copiando archivos buildados a data/static..."
docker cp pentestia-ui:/app/dist/. data/static/
echo "✅ Build completado! Los archivos están en data/static/"
echo "🌐 Ahora puedes reiniciar nginx para servir los archivos estáticos"
echo "💡 Comando: docker-compose restart pentestia-nginx"