Files
ai-contract-platform/scripts/deploy-frontend.sh
T
yuqei b7073d9c5b feat: enhance production deployment configuration and documentation
- Update .env.example with production-ready environment variables
- Add frontend Aliyun deployment configuration with nginx gateway
- Refactor docker-compose.server.yml for external services
- Add comprehensive deployment guide (docs/DEPLOYMENT.md)
- Enhance troubleshooting documentation with Git Bash path issues
- Add deployment scripts (build-frontend.sh, deploy-frontend.sh)
- Add deploy directory with docker-compose and nginx config
- Update .gitignore to exclude temporary directories

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-18 22:27:00 +08:00

33 lines
850 B
Bash

#!/bin/bash
# 部署前端到阿里云服务器
set -e
ALIYUN_HOST="47.94.178.212"
REMOTE_APP_DIR="/opt/apps/ai-contract-web/current/app"
REMOTE_DIR="/opt/apps/ai-contract-web/current"
PACKAGE="deploy/frontend-standalone.tar.gz"
if [ ! -f "$PACKAGE" ]; then
echo "Error: $PACKAGE not found. Run scripts/build-frontend.sh first."
exit 1
fi
echo "Uploading to Aliyun..."
scp "$PACKAGE" "root@${ALIYUN_HOST}:/tmp/"
echo "Deploying..."
ssh "root@${ALIYUN_HOST}" << 'REMOTE'
cd /opt/apps/ai-contract-web/current/app
rm -rf .next server.js node_modules public
tar -xzf /tmp/frontend-standalone.tar.gz
cd /opt/apps/ai-contract-web/current
docker compose down
docker compose up -d --build
echo "Waiting for container to start..."
sleep 3
docker compose ps
REMOTE
echo "Deployment complete!"
echo "Test: curl -s http://contact.yuqei.com/healthz"