是一套基于若依的wms仓库管理系统
一、后端部署
后端地址:https://gitee.com/zccbbg/wms-ruoyi/tree/v1/
1、用IDEA拉代码,并修改API统一后缀
2、复制一个配置文件 application-dev.yaml,并修改里面的mysql与redis配置
3、将打包的jar上传至服务器
[root@msh ruoyi-wms]# ll
total 86288
-rw-r--r-- 1 root root 137 Dec 13 11:14 dockerfile
-rw-r--r-- 1 root root 88349707 Dec 19 16:31 ruoyi-admin.jar
-rwxr-xr-x 1 root root 313 Dec 13 11:14 start.sh
4、创建dockerfile
FROM openjdk:8-jdk-alpine
ENV PARAMS=""
COPY ruoyi-admin.jar /home/app.jar
ENTRYPOINT ["/bin/sh","-c","java $PARAMS -jar /home/app.jar"]
5、创建启动脚本
#!/bin/sh
ServiceName=ruoyi-wms
docker rm -f ${ServiceName} || true
docker rmi -f ${ServiceName} || true
docker build -t ${ServiceName} .
docker run \
--name ${ServiceName} \
--restart=always \
-p 8080:8080 \
-e PARAMS='-Dspring.profiles.active=dev' \
-v /etc/localtime:/etc/localtime \
-m 1G \
-d ${ServiceName}
二、前端部署
前端地址:https://github.com/zccbbg/RuoYi-WMS-VUE/tree/v1
1、 VSCode 拉代码并修改 Package.json
2、修改.env.development
3、修改 axios
4、安装并打包
# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
npm install --registry=https://registry.npmmirror.com
# 打包
npm run build:dev
5、把打包好的dist上传到服务器
[root@msh ruoyi-wms-vue]# ll
total 16
drwxr-xr-x 4 root root 4096 Dec 13 11:59 dist
-rw-r--r-- 1 root root 153 Dec 13 11:10 dockerfile
-rw-r--r-- 1 root root 1067 Dec 13 12:01 nginx.conf
-rwxr-xr-x 1 root root 229 Dec 13 11:10 start.sh
6、创建dockerfile
FROM nginx:1.15.1-alpine
USER root
ADD ./dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
# RUN /bin/bash -c 'echo init ok!!!'
7、创建nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /api/ {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' '*';
add_header 'Access-Control-Allow-Headers' '*';
client_max_body_size 35M;
proxy_pass http://192.168.1.84:8080/api/;
}
}
}
8、创建启动脚本 start.sh
#!/bin/sh
ServiceName=ruoyi-wms-vue
docker rm -f ${ServiceName} || true
docker rmi -f ${ServiceName} || true
docker build -t ${ServiceName} .
docker run \
--name ${ServiceName} \
--restart=always \
-p 7000:80 \
-d ${ServiceName}