This commit is contained in:
1 parent
99b11d1a17
commit
a48ee17553
5 files changed
+143
No files matched your search
@@ -75,3 +75,23 @@ npm run typecheck # 仅做 TypeScript 类型检查
|
||||
## 下一步
|
||||
|
||||
把 `src/pages/HomePage.tsx` 和 `src/components/DemoForm.tsx` 换成自己的页面即可。如需路由、状态管理或请求库,可自行添加 React Router、Zustand、TanStack Query 等依赖。
|
||||
|
||||
## 部署
|
||||
|
||||
推送到 `main` 分支会触发 Gitea Actions(`.gitea/workflows/deploy.yml`),自动构建 Docker 镜像并在本机滚动重启容器。
|
||||
|
||||
| 项目 | 值 |
|
||||
| --- | --- |
|
||||
| 生产域名 | https://demo.chener.ymen.site |
|
||||
| 容器名 / 镜像 | `demo` |
|
||||
| 宿主机监听 | `127.0.0.1:9121` → 容器 `80` |
|
||||
| 反向代理 | Caddy(`/etc/caddy/Caddyfile`)自动签发证书 |
|
||||
|
||||
镜像为多阶段构建:`node:24-alpine` 里执行 `npm ci && npm run build`,产物交给 `nginx:1.27-alpine` 提供服务,`deploy/nginx.conf` 负责 SPA 回退与静态资源缓存策略。
|
||||
|
||||
本地手动验证构建:
|
||||
|
||||
```bash
|
||||
docker build -t demo:latest .
|
||||
docker run --rm -p 127.0.0.1:9121:80 demo:latest
|
||||
```
|
||||
Reference in new issue
Block a user