签入版本
This commit is contained in:
@@ -7,7 +7,7 @@ Docker 方案适合快速体验项目功能,无需在本机手动安装 PHP、
|
||||
## 架构说明
|
||||
|
||||
```text
|
||||
浏览器 → localhost:8000 → [Nginx 容器:80] → [PHP-FPM 容器:9000] → Laravel 应用
|
||||
浏览器 → admin.laravel13.antdvue → [Nginx 容器:80] → [PHP-FPM 容器:9000] → Laravel 应用
|
||||
↕
|
||||
[MySQL 容器:3306] + [Redis 容器:6379]
|
||||
```
|
||||
@@ -20,7 +20,7 @@ Docker 方案适合快速体验项目功能,无需在本机手动安装 PHP、
|
||||
## 文件结构
|
||||
|
||||
```text
|
||||
RXThinkCMF_Laravel13_EleVue/
|
||||
RXThinkCMF_Laravel13_AntdVue/
|
||||
├── docker-compose.yml # 容器编排(项目根目录)
|
||||
├── .dockerignore # 构建上下文排除(.env、vendor、SQL 等)
|
||||
├── docker/
|
||||
@@ -51,7 +51,7 @@ composer setup
|
||||
项目已内置完整的 Docker 配置文件(`docker-compose.yml`、`docker/Dockerfile`、`docker/nginx.conf`),无需手动创建,直接启动即可:
|
||||
|
||||
```bash
|
||||
cd RXThinkCMF_Laravel13_EleVue
|
||||
cd RXThinkCMF_Laravel13_AntdVue
|
||||
|
||||
# 启动所有服务(首次会自动构建镜像,约 2-5 分钟)
|
||||
docker compose up -d
|
||||
@@ -135,7 +135,7 @@ services:
|
||||
- DB_CONNECTION=mysql
|
||||
- DB_HOST=mysql
|
||||
- DB_PORT=3306
|
||||
- DB_DATABASE=${MYSQL_DATABASE:-rxthinkcmf.laravel13.elevue}
|
||||
- DB_DATABASE=${MYSQL_DATABASE:-rxthinkcmf.laravel13.antdvue}
|
||||
- DB_USERNAME=root
|
||||
- DB_PASSWORD=${MYSQL_ROOT_PASSWORD:-root123}
|
||||
|
||||
@@ -151,7 +151,7 @@ services:
|
||||
- JWT_SECRET=${JWT_SECRET:-your_random_jwt_secret_key_at_least_32_bytes_long}
|
||||
|
||||
# 文件访问域名(接口返回上传文件的完整地址)
|
||||
- FILE_DOMAIN_URL=${DOMAIN_URL:-http://localhost:8000}
|
||||
- FILE_DOMAIN_URL=${DOMAIN_URL:-http://admin.laravel13.antdvue}
|
||||
|
||||
# 跨域来源(快速体验默认放开)
|
||||
- CORS_ALLOW_ORIGIN=${CORS_ALLOW_ORIGIN:-*}
|
||||
@@ -177,10 +177,10 @@ services:
|
||||
- "${MYSQL_PORT:-3306}:3306" # 宿主机端口(默认 3306),可通过环境变量覆盖
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root123} # root 密码
|
||||
MYSQL_DATABASE: ${MYSQL_DATABASE:-rxthinkcmf.laravel13.elevue} # 自动创建的数据库
|
||||
MYSQL_DATABASE: ${MYSQL_DATABASE:-rxthinkcmf.laravel13.antdvue} # 自动创建的数据库
|
||||
volumes:
|
||||
- mysql_data:/var/lib/mysql # 数据持久化
|
||||
- ./document/mysql/rxthinkcmf.laravel13.elevue.sql:/docker-entrypoint-initdb.d/init.sql:ro # 初始化 SQL(仅首次启动执行)
|
||||
- ./document/mysql/rxthinkcmf.laravel13.antdvue.sql:/docker-entrypoint-initdb.d/init.sql:ro # 初始化 SQL(仅首次启动执行)
|
||||
command:
|
||||
- --character-set-server=utf8mb4
|
||||
- --collation-server=utf8mb4_general_ci
|
||||
@@ -425,9 +425,9 @@ NGINX_PORT=8000
|
||||
MYSQL_PORT=3306
|
||||
REDIS_PORT=6379
|
||||
|
||||
# MySQL(首次启动自动导入 document/mysql/rxthinkcmf.laravel13.elevue.sql)
|
||||
# MySQL(首次启动自动导入 document/mysql/rxthinkcmf.laravel13.antdvue.sql)
|
||||
MYSQL_ROOT_PASSWORD=Your_Strong_Password_2024
|
||||
MYSQL_DATABASE=rxthinkcmf.laravel13.elevue
|
||||
MYSQL_DATABASE=rxthinkcmf.laravel13.antdvue
|
||||
|
||||
# Redis
|
||||
REDIS_PASSWORD=Your_Redis_Password_2024
|
||||
@@ -435,8 +435,8 @@ REDIS_PASSWORD=Your_Redis_Password_2024
|
||||
# 应用
|
||||
JWT_SECRET=<32 字符以上随机值,openssl rand -base64 32 生成>
|
||||
APP_DEBUG=false
|
||||
DOMAIN_URL=http://localhost:8000
|
||||
CORS_ALLOW_ORIGIN=http://localhost:8000
|
||||
DOMAIN_URL=http://admin.laravel13.antdvue
|
||||
CORS_ALLOW_ORIGIN=http://admin.laravel13.antdvue
|
||||
```
|
||||
|
||||
:::tip 与本地 .env 的关系
|
||||
@@ -460,8 +460,8 @@ CORS_ALLOW_ORIGIN=http://localhost:8000
|
||||
|
||||
| 服务 | 地址 | 说明 |
|
||||
|------|------|------|
|
||||
| 后端 API | http://localhost:8000 | Nginx → PHP-FPM → Laravel |
|
||||
| 健康检查 | http://localhost:8000/up | Laravel 内置健康路由 |
|
||||
| 后端 API | http://admin.laravel13.antdvue | Nginx → PHP-FPM → Laravel |
|
||||
| 健康检查 | http://admin.laravel13.antdvue/up | Laravel 内置健康路由 |
|
||||
| MySQL | localhost:3306 | 用户名 root,默认密码 root123 |
|
||||
| Redis | localhost:6379 | 默认密码 redis123 |
|
||||
|
||||
@@ -469,15 +469,15 @@ CORS_ALLOW_ORIGIN=http://localhost:8000
|
||||
|
||||
```bash
|
||||
# 健康检查
|
||||
curl http://localhost:8000/up
|
||||
curl http://admin.laravel13.antdvue/up
|
||||
|
||||
# 验证码(同时验证 PHP→Redis 链路,返回 code=0 即成功)
|
||||
curl http://localhost:8000/api/captcha
|
||||
curl http://admin.laravel13.antdvue/api/captcha
|
||||
# → {"code":0,"ok":true,"msg":"操作成功","data":{...}}
|
||||
|
||||
# 登录获取 Token(默认管理员账号 admin / 123456,登录后立即修改)
|
||||
# 验证码参数 key/code 与 /api/captcha 响应字段一致
|
||||
curl -X POST http://localhost:8000/api/login \
|
||||
curl -X POST http://admin.laravel13.antdvue/api/login \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"username":"admin","password":"123456","key":"<captcha_key>","code":"<验证码字符>"}'
|
||||
```
|
||||
@@ -532,10 +532,10 @@ docker compose exec mysql bash
|
||||
# 数据库操作
|
||||
# --------------------------------------------------------------------------
|
||||
# 导入 SQL(手动方式,首次启动已自动导入)
|
||||
docker compose exec -T mysql mysql -uroot -pYour_Strong_Password_2024 rxthinkcmf.laravel13.elevue < document/mysql/rxthinkcmf.laravel13.elevue.sql
|
||||
docker compose exec -T mysql mysql -uroot -pYour_Strong_Password_2024 rxthinkcmf.laravel13.antdvue < document/mysql/rxthinkcmf.laravel13.antdvue.sql
|
||||
|
||||
# 进入 MySQL 命令行
|
||||
docker compose exec mysql mysql -uroot -pYour_Strong_Password_2024 rxthinkcmf.laravel13.elevue
|
||||
docker compose exec mysql mysql -uroot -pYour_Strong_Password_2024 rxthinkcmf.laravel13.antdvue
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Laravel Artisan 命令
|
||||
|
||||
Reference in New Issue
Block a user