Files
Environment-Monitoring-System/docs/Docker_拉取与运行指南.md
2026-01-29 04:25:44 +08:00

43 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Docker 拉取与运行指南(本地部署)
本指南帮助他人使用预构建镜像在本地运行系统。
## 先决条件
- Docker DesktopWindows或 Docker Engine + Compose
- 能访问镜像仓库的网络
## 1) 登录私有仓库
```bash
docker login docker.aizhangz.top
```
## 2) 创建环境文件
在项目根目录创建 `.env` 文件(示例):
```
APP_BASE_URL=http://localhost:5173
TOKEN_SIGNING_KEY=please-change-me
JWT_SECRET=please-change-me
VOLCANO_API_KEY=
SPRING_MAIL_USERNAME=
SPRING_MAIL_PASSWORD=
```
## 3) 使用私有仓库镜像启动
```bash
docker compose -f docker-compose.private.yml up -d --pull always
```
## 4) 访问
- 前端http://localhost:5173
- 后端http://localhost:8080
## 可选:停止并移除
```bash
docker compose -f docker-compose.private.yml down
```
## 注意事项
- 登录失败时,请检查仓库地址与账号凭据。
- 若之前登录后 API 请求出现 401/403请清理浏览器 localStorage 中的 token
- 打开 DevTools → Application → Local Storage → 删除 `token`