b7073d9c5b
- 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>
47 lines
1.5 KiB
YAML
47 lines
1.5 KiB
YAML
# AI Contract Platform 前端阿里云部署配置
|
|
# 部署位置: 阿里云 /opt/apps/ai-contract-web
|
|
#
|
|
# ⚠️ 重要提示:NEXT_PUBLIC_API_BASE_URL 和 BACKEND_BASE_URL 必须在构建时设置!
|
|
# 运行时的 environment 设置无效,因为这些值会被硬编码到 JS 文件中。
|
|
# 构建命令:MSYS_NO_PATHCONV=1 NEXT_PUBLIC_API_BASE_URL="/api/v1" BACKEND_BASE_URL="http://10.20.0.11:18083" npm run build
|
|
|
|
version: "3.9"
|
|
|
|
services:
|
|
ai-contract-web:
|
|
build:
|
|
context: ./app
|
|
dockerfile: Dockerfile
|
|
image: local/ai-contract-web:0.0.1
|
|
container_name: ai-contract-web
|
|
restart: unless-stopped
|
|
environment:
|
|
NODE_ENV: production
|
|
HOSTNAME: 0.0.0.0
|
|
PORT: 3000
|
|
# 注意:以下环境变量在运行时设置无效!
|
|
# 它们必须在构建时通过 npm run build 设置:
|
|
# MSYS_NO_PATHCONV=1 NEXT_PUBLIC_API_BASE_URL="/api/v1" BACKEND_BASE_URL="http://10.20.0.11:18083" npm run build
|
|
extra_hosts:
|
|
# 让容器能访问内网 IP(映射到 Docker 宿主机)
|
|
- "10.20.0.11:host-gateway"
|
|
networks:
|
|
- ai-contract-web-proxy
|
|
|
|
ai-contract-web-gateway:
|
|
image: nginx:1.27-alpine
|
|
container_name: ai-contract-web-gateway
|
|
restart: unless-stopped
|
|
ports:
|
|
- "127.0.0.1:18083:80"
|
|
volumes:
|
|
- ./nginx/web-gateway.conf:/etc/nginx/conf.d/default.conf:ro
|
|
- /opt/apps/ai-contract-web/logs/nginx:/var/log/nginx
|
|
depends_on:
|
|
- ai-contract-web
|
|
networks:
|
|
- ai-contract-web-proxy
|
|
|
|
networks:
|
|
ai-contract-web-proxy:
|
|
name: ai-contract-web-proxy |