1、HbuliderX   H5项目发布 ##npm run build

 

 

HbuliderX   H5前端部署+Nginx+docker20220912_h5

 

npm run build  生成dist

 

 

 

HbuliderX   H5前端部署+Nginx+docker20220912_nginx_02

 

2、生成Nginx容器XXX80-h5

 

 

HbuliderX   H5前端部署+Nginx+docker20220912_h5_03

 

   

3、H5发布包dist 上传到 容器XXX80-h5  目录home/html

 1)、容器XXX80-h5创建home/html目录用来存入H5发布包dist

 

 

    

HbuliderX   H5前端部署+Nginx+docker20220912_nginx_04

 

    2)、H5发布包dist上传到宿主机

HbuliderX   H5前端部署+Nginx+docker20220912_h5_05

 

 

 

 

HbuliderX   H5前端部署+Nginx+docker20220912_h5_06

 

 

 

 

    3)、H5发布包dist   从宿主机复制到容器XXX80-h5  的目录/home/html

HbuliderX   H5前端部署+Nginx+docker20220912_nginx_07

 

 

HbuliderX   H5前端部署+Nginx+docker20220912_h5_08

 

  

 

 4、配置 Nginx容器的nginx.conf  【容器XXX80-h5】

   1)、先在宿主机  修改nginx的配置nginx.conf

 

 

 

 

HbuliderX   H5前端部署+Nginx+docker20220912_html_09

proxy_pass  http://172.17.0.11:8080 后端api地址

 

HbuliderX   H5前端部署+Nginx+docker20220912_html_10

 

 

   2)、宿主机配置文件nginx.conf复制到 容器XXX80-h5 的目录etc/nginx/

 

HbuliderX   H5前端部署+Nginx+docker20220912_h5_11

 

 

  3)、 查看 容器XXX80-h5 的目录etc/nginx/nginx.conf文件如下

  

HbuliderX   H5前端部署+Nginx+docker20220912_nginx_12

 

 

HbuliderX   H5前端部署+Nginx+docker20220912_h5_13

 

 

   4)、重启容器XXX80-h5

HbuliderX   H5前端部署+Nginx+docker20220912_html_14

 

 

   

 

5、访问H5项目

 

HbuliderX   H5前端部署+Nginx+docker20220912_h5_15

 

 

 

 

 

 

 

 

 

 

 

在windows  nginx部署h5前端项目

HbuliderX   H5前端部署+Nginx+docker20220912_nginx_16

 

 

HbuliderX   H5前端部署+Nginx+docker20220912_html_17

 

  注:proxy_pass  http://192.168.254.171:9090/   后端api