Files
Artveris/scripts/README.md
T

26 lines
1023 B
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.
# scripts · 一键脚本
所有环境配置集中在 [`config.yaml`](./config.yaml)(带注释)。脚本会据此自动生成根目录 `.env`,**无需手改 .env**。
脚本现在直接用本机 Python 运行。首次运行前请先安装脚本依赖:
```bash
python -m pip install pyyaml psutil pymysql
```
| 脚本 | 作用 |
| --- | --- |
| `python scripts/dev.py` | 本地开发:生成 .env → 起 MySQL/Redis → 构建 shared → 迁移+种子 → 同时启动 api/admin/h5 |
| `python scripts/docker_build.py` | 构建:生成 .env → 构建前端静态 → 构建 API 镜像 |
| `python scripts/docker_dev.py` | Docker 运行全栈(`--down` 停止,`--logs` 看日志) |
常用参数:
```bash
python scripts/dev.py --install # 首次:先 pnpm install
python scripts/dev.py --no-seed # 跳过种子数据
python scripts/docker_dev.py --down # 停止全栈
```
修改 `config.yaml`(如平台名、端口、存储/区块链 driver、账号密码)后,重跑脚本即生效。