2024-03-06 17:01:57 +08:00
|
|
|
|
# GreaterWMS Docker 部署及手机 App 的使用
|
|
|
|
|
|
|
|
|
|
## 1. 前期准备
|
|
|
|
|
|
|
|
|
|
需要先安装 docker-compose 工具:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# Manjaro
|
|
|
|
|
sudo pacman -S docker-compose
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 2. 安装 GreaterWMS
|
|
|
|
|
|
|
|
|
|
以 GreaterWMS-2.1.48 为例,先从 [github GreaterWMS V2.1.48](https://github.com/GreaterWMS/GreaterWMS/tree/V2.1.48) 上下载 zip 包,然后解压:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
unzip GreaterWMS-2.1.48.zip
|
|
|
|
|
cd GreaterWMS-2.1.48
|
|
|
|
|
chmod +x *.sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
修改 docker-compose.yml 中的端口映射(以映射端口 9080 和 9008 为例):
|
|
|
|
|
|
|
|
|
|
```yml
|
|
|
|
|
container_name: greaterwms_front
|
|
|
|
|
image: greaterwms/greaterwms:front
|
|
|
|
|
restart: always
|
|
|
|
|
privileged: true
|
|
|
|
|
ports:
|
|
|
|
|
- '9080:8080'
|
|
|
|
|
......
|
|
|
|
|
container_name: greaterwms_backend
|
|
|
|
|
image: greaterwms/greaterwms:backend
|
|
|
|
|
restart: always
|
|
|
|
|
privileged: true
|
|
|
|
|
volumes:
|
|
|
|
|
- ./:/GreaterWMS/:rw
|
|
|
|
|
- ./supervisord.conf:/etc/supervisor/supervisord.conf
|
|
|
|
|
ports:
|
|
|
|
|
- '9008:8008'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
修改 nginx.conf 中的端口:
|
|
|
|
|
|
|
|
|
|
```conf
|
|
|
|
|
upstream GreaterWMS{
|
|
|
|
|
server 127.0.0.1:9008;
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
修改 templates/public/statics/baseurl.txt,当前手机 App 只支持 https 协议,因此这里需要用 https 开头,我们以 https://my.greaterwms.app 这个地址为例进行说明:
|
|
|
|
|
|
|
|
|
|
```txt
|
|
|
|
|
https://my.greaterwms.app
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
然后使用:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
docker-compose up -d
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
进行构建,构建完毕后提示:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
⠼ Network greaterwms-xxxxx Created 0.1s
|
|
|
|
|
✔ Container greaterwms_backend Started 0.1s
|
|
|
|
|
✔ Container greaterwms_front Started 0.1s
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
之后等待前端进行编译,直到 templates/dist/spa 中看到生成的前端代码即可。如果前端没有编译,可以使用以下命令进入前端自行编译:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# 进入前端容器
|
|
|
|
|
docker exec -it greaterwms_front /bin/bash
|
|
|
|
|
# 编译前端代码
|
|
|
|
|
quasar build
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
目前未发现前后端的明显差别。
|
|
|
|
|
|
|
|
|
|
配置好域名或者反向代理后在浏览器中输入 https://my.greaterwms.app,注册管理员即可使用。GreaterWMS 的一个管理员对应一个使用域。
|
|
|
|
|
|
|
|
|
|
## 3. 手机端安装和配置
|
|
|
|
|
|
|
|
|
|
GreaterWMS 提供 apks 安装包,该安装包需要使用 sai 工具进行安装,可以从下面连接下载 sai 和 GWMS,或者从官网下载。
|
|
|
|
|
|
|
|
|
|
- [SAIanzhuangqi.apk](./apps/SAIanzhuangqi.apk)
|
|
|
|
|
- [GWMS.apks](./apps/GWMS.apks)
|
|
|
|
|
|
|
|
|
|
安装好 GWMS 后进入 Settings->Server,修改如下:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
你的OPENID: xxxxxxxxxxxxxxxx
|
2024-03-07 02:06:45 +08:00
|
|
|
|
请求地址:https://my.greaterwms.app/
|
2024-03-06 17:01:57 +08:00
|
|
|
|
```
|
|
|
|
|
|
2024-03-07 02:06:45 +08:00
|
|
|
|
OPENID 可以从网站上得到,请求地址必须使用 https 协议。管理员登录不需要 OPENID。请求地址必须以“/”结尾。
|
2024-03-06 17:01:57 +08:00
|
|
|
|
|
|
|
|
|
## 4. 卸载和删除
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# 删除容器
|
|
|
|
|
docker-compose down
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
再使用 docker image rm 命令删除对应镜像。
|
|
|
|
|
|
|
|
|
|
需要注意的是,docker 安装会将一些信息写入到 host 目录中,比如账户信息。因此最后要删除 GreaterWMS-2.1.48 目录。
|
|
|
|
|
|
|
|
|
|
## 5. 外部参考资料
|
|
|
|
|
|
|
|
|
|
1. [GreaterWMS Team](https://www.56yhz.com/)
|
|
|
|
|
2. [仓库管理系统GreaterWMS的安装](https://blog.csdn.net/wbsu2004/article/details/128392486)
|