重构后端服务架构并优化前端错误处理
This commit is contained in:
@@ -114,21 +114,35 @@ sudo systemctl enable redis-server
|
||||
|
||||
### 3. 后端服务部署
|
||||
|
||||
#### 代码部署
|
||||
#### Node.js版部署
|
||||
```bash
|
||||
# 克隆代码
|
||||
cd /var/www/niumall
|
||||
sudo git clone <repository-url> .
|
||||
|
||||
# 安装后端依赖
|
||||
# 安装依赖
|
||||
cd backend
|
||||
sudo npm install --production
|
||||
|
||||
# 复制环境配置
|
||||
# 环境配置
|
||||
sudo cp .env.example .env.production
|
||||
sudo vim .env.production
|
||||
```
|
||||
|
||||
#### Java版部署
|
||||
```bash
|
||||
# 构建服务
|
||||
cd /var/www/niumall/backend-java/user-service
|
||||
sudo ./mvnw clean package
|
||||
|
||||
# 运行服务
|
||||
sudo java -jar target/*.jar --spring.profiles.active=prod
|
||||
|
||||
# 或用Docker部署
|
||||
sudo docker build -t user-service .
|
||||
sudo docker run -d -p 8081:8081 user-service
|
||||
```
|
||||
|
||||
#### 环境配置
|
||||
```bash
|
||||
# .env.production
|
||||
|
||||
Reference in New Issue
Block a user