- ci.yml 增加 deploy job:verify 全绿后 rsync 到 /opt/kanban/dist 并做线上自检 - runner 与站点同机(host 模式),部署直接写本地目录,不依赖 SSH 密钥与 Secrets - 站点目录是容器 bind mount,必须原地同步;manual deploy.sh 同步改为 rsync 语义 - 新增 deploy/:容器版 nginx 配置、runner 配置与 systemd 单元、服务器初始化脚本 - README 更新实际部署架构(1Panel + Nginx Proxy Manager 反代)与 runner 说明
54 lines
1.5 KiB
Plaintext
54 lines
1.5 KiB
Plaintext
# 看板 · 容器内站点配置
|
|
#
|
|
# 由 kanban 容器挂载到 /etc/nginx/conf.d/default.conf。
|
|
# 站点根目录是容器内的 /usr/share/nginx/html,对应宿主机 /opt/kanban/dist。
|
|
# 宿主机不需要装 Nginx —— 80/443 由已有的 Nginx Proxy Manager 接管,反代到本容器。
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
charset utf-8;
|
|
|
|
# 构建产物带 hash,长期强缓存(只加一条 Cache-Control,避免与 expires 叠加)
|
|
location /assets/ {
|
|
add_header Cache-Control "public, max-age=31536000, immutable";
|
|
try_files $uri =404;
|
|
}
|
|
|
|
# Service Worker 与入口 HTML 不能缓存,否则发布后客户端停在旧版本
|
|
location = /sw.js {
|
|
expires off;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
}
|
|
|
|
location = /index.html {
|
|
expires off;
|
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
}
|
|
|
|
location = /manifest.webmanifest {
|
|
default_type application/manifest+json;
|
|
expires off;
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
|
|
# 前端路由:/today 刷新时磁盘上没有该文件,必须回落
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_min_length 1024;
|
|
gzip_types
|
|
text/plain
|
|
text/css
|
|
application/javascript
|
|
application/json
|
|
application/manifest+json
|
|
image/svg+xml;
|
|
}
|