Files
web/run-docker.sh
2026-03-17 01:00:11 +08:00

25 lines
831 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 在 Docker 中运行项目,统一域名: https://yuheng.yuxindazhineng.com
# 端口: 9527=api, 9528=index, 9529=admin直连对外通过 nginx 80/443
set -e
cd "$(dirname "$0")"
echo "=== yh_web Docker 启动 ==="
echo "对外域名与 HTTPS 由 Nginx Proxy Manager 配置,本机端口: 9527=api, 9528=web, 9529=admin"
echo ""
# 可选:从 server/.env 加载到当前 shell供 docker-compose 使用
if [ -f server/.env ]; then
set -a
source server/.env
set +a
echo "已加载 server/.env"
fi
docker compose build --no-cache 2>/dev/null || docker-compose build --no-cache
docker compose up -d 2>/dev/null || docker-compose up -d
echo ""
echo "已启动。请用 NPM 配置的域名访问(如 https://yuheng.yuxindazhineng.com"
echo "直连: api :9527, web :9528, admin :9529"