refactor(deploy): 部署方案改为 1Panel 原生集成
- 移除系统 nginx 配置(1Panel 用内置 OpenResty,系统 nginx 不适用) - 站点反代改用 1Panel 网站-反向代理;容器改用 1Panel Compose 编排 - 定时触发由 systemd timer 改为 1Panel 计划任务(日志面板可视) - 脚本上传改用 1Panel 文件管理器,PULL_DEPLOY.md 全步骤 1Panel 化 - deploy.sh/deploy-watch.sh 核心逻辑不变(原子切换+健康检查+回滚)
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
# lunar-server 容器编排(doc79 同机部署)
|
||||
# 用法:保存到 /opt/lunar/docker-compose.yml,先创建 /opt/lunar/production/.env
|
||||
# (包含全部生产环境变量,见 PULL_DEPLOY.md),然后:
|
||||
# docker compose up -d
|
||||
# 之后 CI 产物由 deploy-watch.sh 自动替换 /opt/lunar/production/current 并重启容器。
|
||||
# lunar-server 容器编排(doc79 同机部署,通过 1Panel Compose 编排创建)
|
||||
# 用法:1Panel → 容器 → Compose → 创建编排,粘贴本文件内容后部署。
|
||||
# 前置:先在 /opt/lunar/production/.env 写入全部生产环境变量(模板见 PULL_DEPLOY.md)。
|
||||
# 之后 CI 产物由 1Panel 计划任务触发的 deploy-watch.sh 自动替换
|
||||
# /opt/lunar/production/current 并重启容器(container_name 必须保持 lunar-server,
|
||||
# deploy.sh 按此名称重启)。
|
||||
|
||||
services:
|
||||
lunar-server:
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
# lunar.neatcn.com — Nginx 反向代理配置(doc79 同机部署)
|
||||
# 用法二选一:
|
||||
# A. 1Panel(推荐):网站 → 创建网站 → 反向代理,主机域名 lunar.neatcn.com,
|
||||
# 代理地址 http://127.0.0.1:8080,然后申请 Let's Encrypt 证书并开启 HTTPS。
|
||||
# B. 手工:将本文件放入 nginx conf.d,证书路径按实际填写后 reload。
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name lunar.neatcn.com;
|
||||
# HTTPS 就绪后全部跳转
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
server_name lunar.neatcn.com;
|
||||
|
||||
# 证书路径按实际申请位置调整(1Panel 站点证书在其站点目录下)
|
||||
ssl_certificate /etc/nginx/ssl/lunar.neatcn.com.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/lunar.neatcn.com.key;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
|
||||
# 小程序 request / 管理后台均走这里 → 本机 Go 服务
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8080;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 60s;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user