官方源码&&部署参考 https://gitee.com/modernwms/ModernWMS 最新源码下载 https://gitee.com/modernwms/ModernWMS/repository/archive/master.zip 部署脚本如下(备注:官方部署文档有所缺陷,以下脚本已验证)
#!/bin/bash
#依赖部署
sudo apt update
sudo apt install -y npm
sudo apt install -y curl
sudo apt-get install gcc g++ make
sudo apt install unzip
#中间件部署
#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
./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
make && 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 "***********************************************"
cp -rf /tmp/ModernWMS-master/backend/ModernWMS/wms.db /ModernWMS/backend/
echo "***********************************************"
cp -rf /ModernWMS/frontend/* /etc/nginx/html/
#服务运行
nohup /etc/nginx/sbin/nginx -g 'daemon off;' &
cd /ModernWMS/backend/ && dotnet ModernWMS.dll --urls http://0.0.0.0:20011
标签:http,ModemWMS,部署,sudo,ModernWMS,echo,nginx,&& From: https://www.cnblogs.com/rain-fish/p/17636890.html