Summary: - Created Node.js backend Docker image build guide - Updated deployment progress overview with backend status - Updated system status documentation Backend build achievements: - Fixed 200+ TypeScript compilation errors (200+ to 0) - Completed Prisma reverse sync (32 models from RDS) - Manually added 30+ Prisma relation fields - Successfully built Docker image (838MB) - Pushed image to ACR (v1.0 + latest tags) Documentation updates: - Added 10-Node.js后端-Docker镜像构建手册.md - Updated 00-部署进度总览.md with backend deployment status - Updated 00-系统当前状态与开发指南.md with latest progress - Fixed date format (2024 -> 2025) Next steps: - Deploy Node.js backend to SAE - Configure environment variables - Test end-to-end functionality Status: Backend Docker image ready for SAE deployment
38 lines
1.1 KiB
Bash
38 lines
1.1 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
# ⚠️ 关键:不给默认值,强制在 SAE 控制台配置
|
|
# 如果未配置,报错退出(避免使用错误的后端地址)
|
|
if [ -z "$BACKEND_SERVICE_HOST" ]; then
|
|
echo "❌ ERROR: BACKEND_SERVICE_HOST environment variable is required!"
|
|
echo "Please configure it in SAE console with backend internal IP (e.g., 172.17.x.x)"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$BACKEND_SERVICE_PORT" ]; then
|
|
echo "⚠️ WARNING: BACKEND_SERVICE_PORT not set, using default: 3001"
|
|
export BACKEND_SERVICE_PORT=3001
|
|
fi
|
|
|
|
echo "============================================"
|
|
echo "Starting Frontend Nginx Service"
|
|
echo "Backend Service: ${BACKEND_SERVICE_HOST}:${BACKEND_SERVICE_PORT}"
|
|
echo "Container Timezone: $(cat /etc/timezone)"
|
|
echo "Current Time: $(date)"
|
|
echo "============================================"
|
|
|
|
# 使用 envsubst 替换 Nginx 配置中的环境变量
|
|
envsubst '${BACKEND_SERVICE_HOST} ${BACKEND_SERVICE_PORT}' \
|
|
< /etc/nginx/templates/nginx.conf.template \
|
|
> /etc/nginx/nginx.conf
|
|
|
|
# 验证 Nginx 配置
|
|
nginx -t
|
|
|
|
# 启动 Nginx
|
|
exec nginx -g 'daemon off;'
|
|
|
|
|
|
|
|
|