diff --git a/README.en.md b/README.en.md index c077923193d47c9f89287ac82f1a4ab2d0041c7c..647947c0988b145b09841563da5204afda70dabf 100644 --- a/README.en.md +++ b/README.en.md @@ -159,9 +159,10 @@ pc v5 - Serialization Warning Issue Note: As of PHP 8.1.0, classes that implement the Serializable interface will have a deprecation warning if they do not implement both the __serialize() and __unserialize() methods. Opis\\Closure\\SerializableClosure implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) + vendor/opis/closure/src/SerializableClosure.php ``` -添加以下代码: +insert code: public function __serialize() { return $this->serialize(); @@ -171,6 +172,38 @@ public function __unserialize($data) $this->unserialize($data); } ``` +## Docker Deployment + + +### Prerequisites + +- Docker +- Docker Compose + +### Deployment Steps + +1. Ensure that you have configured the server/.env file. + +2. Run the following commands in the project root directory: +```bash +# Build and start the services +docker-compose up -d + +# Check the status of the services +docker-compose ps + +# View the service logs +docker-compose logs -f server + +# Stop the services +docker-compose down + +# Restart the services +docker-compose restart + +# Rebuild and start the services +docker-compose up -d --build +``` # Manual (文档) diff --git a/README.md b/README.md index 30ba8ab43cf8d7c474aeec4941a98aee4ef3c52a..a276dc5c125b24c9f9939bbb9d8e6d880f934067 100644 --- a/README.md +++ b/README.md @@ -155,6 +155,7 @@ pc端页面伪静态 v5版本-序列化警告问题 注意:从 PHP 8.1.0 起,实现 Serializable 接口的类如果没有同时实现 __serialize()、__unserialize() 方法,将产生弃用警告。 Opis\\Closure\\SerializableClosure implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) + vendor/opis/closure/src/SerializableClosure.php ``` 添加以下代码: @@ -167,6 +168,40 @@ public function __unserialize($data) $this->unserialize($data); } ``` + +## Docker 部署 + + +### 前置要求 + +- Docker +- Docker Compose + +### 部署步骤 + +1. 确保你已经配置好 `server/.env` 文件 + +2. 在项目根目录下运行: +```bash +# 构建并启动服务 +docker-compose up -d + +# 查看服务状态 +docker-compose ps + +# 查看服务日志 +docker-compose logs -f server + +# 停止服务 +docker-compose down + +# 重启服务 +docker-compose restart + +# 重新构建并启动服务 +docker-compose up -d --build +``` + # Manual (文档) https://www.workerman.net/doc/webman diff --git a/admin/Dockerfile b/admin/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..abe62495a8c073043f40386483044843cedb6a25 --- /dev/null +++ b/admin/Dockerfile @@ -0,0 +1,32 @@ +# 构建阶段 +FROM node:20-alpine as build-stage + +# 设置工作目录 +WORKDIR /app + +# 复制 package.json 和 package-lock.json (如果存在) +COPY package*.json ./ + +# 安装依赖 +RUN npm install + +# 复制项目文件 +COPY . . + +# 构建项目 +RUN npm run build + +# 生产阶段 +FROM nginx:stable-alpine as production-stage + +# 复制构建产物到 Nginx 目录 +COPY --from=build-stage /app/dist /usr/share/nginx/html + +# 复制自定义 Nginx 配置(如果需要) +COPY nginx.conf /etc/nginx/conf.d/default.conf + +# 暴露 80 端口 +EXPOSE 80 + +# 启动 Nginx +CMD ["nginx", "-g", "daemon off;"] diff --git a/admin/README.md b/admin/README.md index 077a5686439311c2998853eda66ffe6324da839b..d479bdc477527ea0615a00e717996a3cc389d3e0 100644 --- a/admin/README.md +++ b/admin/README.md @@ -44,3 +44,26 @@ npm run build ```sh npm run lint ``` + +### Docker 使用说明 + +构建镜像: +```bash +# 构建指定版本 +docker build -t admin-vue:1.0.0 . + +# 构建并同时标记为 latest +docker build -t admin-vue:1.0.0 -t admin-vue:latest . + +# 仅构建 latest 版本 +docker build -t admin-vue:latest . +``` + +运行容器: +```bash +# 运行指定版本 +docker run -d -p 80:8001 admin-vue:1.0.0 + +# 运行最新版本 +docker run -d -p 80:8001 admin-vue:latest +``` diff --git a/admin/nginx.conf b/admin/nginx.conf new file mode 100644 index 0000000000000000000000000000000000000000..d8c17eb2346242ca6118f3c81bd06d12e39c02d0 --- /dev/null +++ b/admin/nginx.conf @@ -0,0 +1,26 @@ +server { + listen 8001; + server_name 127.0.0.1; + + root /usr/share/nginx/html; + index index.html; + + # gzip 配置 + gzip on; + gzip_min_length 1k; + gzip_comp_level 9; + gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml; + gzip_vary on; + gzip_disable "MSIE [1-6]\."; + + # 路由重写,支持 history 模式 + location / { + try_files $uri $uri/ /index.html; + } + + # 静态资源缓存 + location /assets { + expires 1y; + add_header Cache-Control "public, no-transform"; + } +} \ No newline at end of file diff --git a/admin/src/components/analysis-xlsx/index.vue b/admin/src/components/analysis-xlsx/index.vue index 25fccda2f8a75f2c79d7e72176735440db9fcbac..f7376acbfab7c10b106abbde4678c5731f5519c4 100644 --- a/admin/src/components/analysis-xlsx/index.vue +++ b/admin/src/components/analysis-xlsx/index.vue @@ -1,10 +1,10 @@