Translation_app_ / scripts /deploy_docker.sh
Athena1621's picture
feat: Implement Multi-Lingual Product Catalog Translator frontend with Streamlit
67f25fb
#!/bin/bash
echo "========================================"
echo " Multi-Lingual Catalog Translator"
echo " Docker Deployment"
echo "========================================"
echo
echo "πŸ”§ Checking Docker installation..."
if ! command -v docker &> /dev/null; then
echo "❌ Docker not found! Please install Docker"
echo "πŸ“₯ Visit: https://docs.docker.com/get-docker/"
exit 1
fi
echo "βœ… Docker found"
if ! command -v docker-compose &> /dev/null; then
echo "❌ Docker Compose not found! Please install Docker Compose"
echo "πŸ“₯ Visit: https://docs.docker.com/compose/install/"
exit 1
fi
echo "βœ… Docker Compose found"
echo
echo "πŸ—οΈ Building and starting containers..."
echo "This may take several minutes on first run..."
echo
docker-compose up --build -d
if [ $? -ne 0 ]; then
echo "❌ Failed to start containers"
echo
echo "πŸ“‹ Checking logs:"
docker-compose logs
exit 1
fi
echo
echo "βœ… Containers started successfully!"
echo
echo "⏳ Waiting for services to be ready..."
sleep 30
echo
echo "πŸ” Checking service health..."
docker-compose ps
echo
echo "πŸ“± Access your application:"
echo "πŸ”— Frontend UI: http://localhost:8501"
echo "πŸ”— Backend API: http://localhost:8001"
echo "πŸ”— API Docs: http://localhost:8001/docs"
echo
echo "πŸ’‘ Useful commands:"
echo " View logs: docker-compose logs -f"
echo " Stop services: docker-compose down"
echo " Restart: docker-compose restart"
echo
echo "πŸŽ‰ Docker deployment complete!"
echo "Opening frontend in browser..."
# Try to open browser
if command -v xdg-open &> /dev/null; then
xdg-open http://localhost:8501
elif command -v open &> /dev/null; then
open http://localhost:8501
else
echo "Please open http://localhost:8501 in your browser"
fi
echo
echo "πŸ“Š Following logs (Press Ctrl+C to stop):"
echo "----------------------------------------"
docker-compose logs -f