mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-07 06:12:44 +08:00
- 新增 nginx 配置模板,用于前端服务的反向代理 - 更新 Dockerfile,使用 pnpm 替代 npm 并添加 nginx 配置 - 添加启动脚本,实现后端健康检查和动态配置 nginx - 更新 .env.example,为后端主机添加注释说明 - 优化 docker-compose.yml,明确版本号并调整服务依赖
20 lines
808 B
Bash
20 lines
808 B
Bash
#!/bin/sh
|
||
###
|
||
# @Author: Jefferyhcool 1063474837@qq.com
|
||
# @Date: 2025-04-16 01:57:05
|
||
# @LastEditors: Jefferyhcool 1063474837@qq.com
|
||
# @LastEditTime: 2025-04-16 01:59:37
|
||
# @FilePath: /hotfix-dev/BillNote_frontend/deploy/start.sh
|
||
# @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||
###
|
||
# 等待后端健康检查通过
|
||
until curl -s "http://backend:${BACKEND_PORT}/health" > /dev/null; do
|
||
echo "等待后端服务就绪..."
|
||
sleep 2
|
||
done
|
||
|
||
# 生成 nginx 配置文件(动态变量替换)
|
||
envsubst '${BACKEND_HOST} ${BACKEND_PORT}' < /etc/nginx/templates/default.conf.template > /etc/nginx/conf.d/default.conf
|
||
|
||
# 启动 Nginx(在前台运行)
|
||
exec nginx -g 'daemon off;' |