官方源码&&部署参考
 
最新源码下载
https://gitee.com/modernwms/ModernWMS/repository/archive/master.zip
 
ubuntu20.04部署脚本如下(备注:官方部署文档有所缺陷,以下脚本已验证,部署请将编译部分ip替换
#!/bin/bash
#2023年修改
#依赖部署
sudo apt update
sudo apt install -y npm
sudo apt install -y curl
sudo apt-get install gcc g++ make-y
sudo apt install unzip -y
sudo apt-get install libpcre3 libpcre3-dev -y
sudo apt-get install zlib1g-dev -y
sudo apt-get install openssl -y


#中间件部署
#NET SDK

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update && sudo apt-get install -y dotnet-sdk-7.0

#nodejs

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install -y nodejs
sudo npm install -g yarn

#Nginx

cd /tmp/ && wget http://nginx.org/download/nginx-1.18.0.tar.gz
tar -zxvf nginx-1.18.0.tar.gz && cd nginx-1.18.0
sudo ./configure --prefix=/etc/nginx --with-http_secure_link_module --with-http_stub_status_module --with-http_realip_module --without-http_rewrite_module --without-http_gzip_module
sudo make && sudo  make install

#ModemWMS源码编译
cd /tmp/ && wget https://gitee.com/modernwms/ModernWMS/repository/archive/master.zip
echo "***********************************************"
cd /tmp/ && unzip master.zip && cd ./ModernWMS-master
echo "***********************************************"
sudo mkdir -p /ModernWMS/frontend/ /ModernWMS/backend/
echo "***********************************************"
cd /tmp/ModernWMS-master/frontend/
echo "***********************************************"
sudo sed -i 's#http://127.0.0.1#http://(括号及其文字替换本地ip)#g' ./.env.production
echo "***********************************************"
yarn && yarn build
echo "***********************************************"
sudo cp -rf /tmp/ModernWMS-master/frontend/dist/* /ModernWMS/frontend/
echo "***********************************************"
cd /tmp/ModernWMS-master/backend/
echo "***********************************************"
sudo dotnet publish
echo "***********************************************"
sudo cp -rf /tmp/ModernWMS-master/backend/ModernWMS/bin/Debug/net7.0/publish/* /ModernWMS/backend/
echo "***********************************************"
sudo cp -rf /tmp/ModernWMS-master/backend/ModernWMS/wms.db /ModernWMS/backend/
echo "***********************************************"
sudo cp -rf /ModernWMS/frontend/* /etc/nginx/html/
sudo touch /etc/nginx/logs/error.log
sudo chmod 777 /etc/nginx/logs/error.log
sudo mkdir /etc/nginx/client_body_temp
sudo chmod 777 -R /etc/nginx/client_body_temp

#服务运行(可单独编制脚本)
nohup /etc/nginx/sbin/nginx -g 'daemon off;' &
cd /ModernWMS/backend/ && dotnet ModernWMS.dll --urls http://0.0.0.0:20011

 

posted on 2023-08-17 11:11  rain_雨  阅读(632)  评论(6编辑  收藏  举报