CaiWuXiTong/deploy/local-healthcheck.sh
92451 7e4a30365d fix: 完善本地热更新开发环境 (#250)
启用本地 PHP 与前端资源热更新,并同步初始化脚本与健康检查。
Co-authored-by: 92451 <924518135@qq.com>
Co-committed-by: 92451 <924518135@qq.com>
2026-09-23 12:50:16 +08:00

22 lines
627 B
Bash

#!/bin/sh
set -eu
for required_asset in \
public/js/manifest.js \
public/js/vendor.js \
public/css/app.css \
public/mix-manifest.json \
public/vendor/apexcharts/apexcharts.min.js \
public/vendor/js-cookie/js.cookie.js
do
test -s "$required_asset"
done
runuser -u www-data -- php artisan app:ready --quiet
# Artisan 能先于 Apache 启动完成;必须同时确认真实 HTTP 入口已经响应,
# 防止初始化脚本在容器“看似健康”时过早访问并得到空响应。
curl --fail --silent --show-error --max-time 5 \
http://127.0.0.1:18088/serviceworker.js \
>/dev/null