Files
AIclinicalresearch/frontend-v2/docker-entrypoint.sh
HaHafeng 4c5bb3d174 feat(iit): Initialize IIT Manager Agent MVP - Day 1 complete
- Add iit_schema with 5 tables
- Create module structure and types (223 lines)
- WeChat integration verified (Access Token success)
- Update system docs to v2.4
- Add REDCap source folders to .gitignore
- Day 1/14 complete (11/11 tasks)
2025-12-31 18:35:05 +08:00

45 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;'