Major changes: - Add Docker configuration (Dockerfile, .dockerignore) - Fix 200+ TypeScript compilation errors - Add Prisma schema relations for all models (30+ relations) - Update tsconfig.json to relax non-critical checks - Optimize Docker build with local dist strategy Technical details: - Exclude test files from TypeScript compilation - Add manual relations for ASL, PKB, DC, AIA modules - Use type assertions for JSON/Buffer compatibility - Fix pg-boss, extractionWorker, and other legacy code issues Build result: - Docker image: 838MB (compressed ~186MB) - Successfully pushed to ACR - Zero TypeScript compilation errors Related docs: - Update deployment documentation - Add Python microservice SAE deployment guide
37 lines
1.1 KiB
Bash
37 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;'
|
|
|
|
|
|
|