挂载更新
This commit is contained in:
65
docker/init-volumes.bat
Normal file
65
docker/init-volumes.bat
Normal file
@@ -0,0 +1,65 @@
|
||||
@echo off
|
||||
REM ============================================
|
||||
REM 初始化 Docker Volumes 目录 (Windows)
|
||||
REM ============================================
|
||||
|
||||
echo ========================================
|
||||
echo 初始化 Docker Volumes 目录
|
||||
echo ========================================
|
||||
echo.
|
||||
|
||||
REM 创建所有卷目录(分层结构)
|
||||
echo 创建数据目录...
|
||||
if not exist "volumes" mkdir "volumes"
|
||||
if not exist "volumes\mysql\data" mkdir "volumes\mysql\data"
|
||||
if not exist "volumes\redis\data" mkdir "volumes\redis\data"
|
||||
if not exist "volumes\redis\config" mkdir "volumes\redis\config"
|
||||
if not exist "volumes\serv\config" mkdir "volumes\serv\config"
|
||||
if not exist "volumes\serv\logs" mkdir "volumes\serv\logs"
|
||||
if not exist "volumes\serv\uploads" mkdir "volumes\serv\uploads"
|
||||
REM if not exist "volumes\serv\crawler" mkdir "volumes\serv\crawler" REM 可选,如需运行时更新爬虫可取消注释
|
||||
if not exist "volumes\web\config" mkdir "volumes\web\config"
|
||||
if not exist "volumes\web\logs" mkdir "volumes\web\logs"
|
||||
if not exist "volumes\nginx\config" mkdir "volumes\nginx\config"
|
||||
if not exist "volumes\nginx\logs" mkdir "volumes\nginx\logs"
|
||||
|
||||
REM 复制配置文件模板
|
||||
echo 复制配置文件模板...
|
||||
if exist "redis\redis.conf" (copy /Y "redis\redis.conf" "volumes\redis\config\" >nul) else (echo ⚠️ redis.conf 不存在)
|
||||
if exist "config\application.yml" (copy /Y "config\application.yml" "volumes\serv\config\" >nul) else (echo ⚠️ application.yml 不存在)
|
||||
if exist "config\log4j2-spring.xml" (copy /Y "config\log4j2-spring.xml" "volumes\serv\config\" >nul) else (echo ⚠️ log4j2-spring.xml 不存在)
|
||||
if exist "config\web-app-config.js" (copy /Y "config\web-app-config.js" "volumes\web\config\app-config.js" >nul) else (echo ⚠️ web-app-config.js 不存在)
|
||||
if exist "nginx\nginx.conf" (xcopy /E /Y "nginx\*" "volumes\nginx\config\" >nul) else (echo ⚠️ nginx配置 不存在)
|
||||
REM if exist "..\schoolNewsCrawler" (xcopy /E /Y "..\schoolNewsCrawler\*" "volumes\serv\crawler\" >nul) else (echo ⚠️ 爬虫脚本 不存在) REM 可选
|
||||
|
||||
echo.
|
||||
echo ✅ 目录创建完成:
|
||||
dir /b volumes
|
||||
echo.
|
||||
|
||||
echo ========================================
|
||||
echo 目录结构说明:
|
||||
echo ========================================
|
||||
echo volumes\
|
||||
echo ├── mysql\
|
||||
echo │ └── data\ - MySQL数据库数据
|
||||
echo ├── redis\
|
||||
echo │ ├── data\ - Redis缓存数据
|
||||
echo │ └── config\ - Redis配置文件
|
||||
echo ├── serv\
|
||||
echo │ ├── config\ - 后端配置文件
|
||||
echo │ ├── logs\ - 后端服务日志
|
||||
echo │ ├── uploads\ - 后端上传文件
|
||||
echo │ └── crawler\ - 爬虫脚本(可选,默认在镜像内)
|
||||
echo ├── web\
|
||||
echo │ ├── config\ - 前端配置文件
|
||||
echo │ └── logs\ - 前端服务日志
|
||||
echo └── nginx\
|
||||
echo ├── config\ - Nginx配置文件
|
||||
echo └── logs\ - Nginx访问日志
|
||||
echo.
|
||||
echo ✅ 初始化完成!现在可以启动服务了:
|
||||
echo docker-compose up -d
|
||||
echo ========================================
|
||||
|
||||
pause
|
||||
Reference in New Issue
Block a user