当前位置: 首页 > news >正文

【Docker】05-Docker部署前端项目

1. nginx.conf


worker_processes  1;events {worker_connections  1024;
}http {include       mime.types;default_type  application/json;sendfile        on;keepalive_timeout  65;server {listen       18080;# 指定前端项目所在的位置location / {root /usr/share/nginx/html/hmall-portal;}error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}location /api {rewrite /api/(.*)  /$1 break;proxy_pass http://hm:8080;}}server {listen       18081;# 指定前端项目所在的位置location / {root /usr/share/nginx/html/hmall-admin;}error_page   500 502 503 504  /50x.html;location = /50x.html {root   html;}location /api {rewrite /api/(.*)  /$1 break;proxy_pass http://hm:8080;}}
}

2. 运行Nginx镜像

docker run -d --name nginx -p 18080:18080 -p 18081:18081 -v /root/docker/nginx/html:/usr/share/nginx/html -v /root/docker/nginx/nginx.conf:/etc/nginx/nginx.conf --network hw nginx
http://www.lryc.cn/news/455646.html

相关文章:

  • SQL进阶技巧:如何优化NULL值引发的数据倾斜问题?
  • 【09】纯血鸿蒙HarmonyOS NEXT星河版开发0基础学习笔记-Class类基础全解(属性、方法、继承复用、判断)
  • 快速提升波段交易技能:4种实用策略分享
  • LeetCode 11 Container with Most Water 解题思路和python代码
  • 【深度学习】损失函数
  • 力扣 中等 46.全排列
  • LabVIEW机床加工监控系统
  • 第五届智能设计国际会议(ICID 2024)
  • 厨房用品分割系统源码&数据集分享
  • 【HTTPS】深入解析 https
  • Axios 快速入门
  • LabVIEW提高开发效率技巧----调度器设计模式
  • python之认识变量
  • c++应用网络编程之十Linux下的Poll模式
  • [C++][第三方库][RabbitMq]详细讲解
  • Next.js 详解
  • pygame--超级马里奥(万字详细版)
  • 【运维】nginx静态代理资源403权限问题
  • java家政预约上门系统源码,家政服务平台源码,基于SpringBoot框架,数据库使用MySQL,界面渲染采用Thymeleaf技术开发
  • 算法知识点————贪心
  • python数据分析
  • UGUI(现成组合控件)
  • 软件交付体系文件(Word源资料)
  • 【视频目标分割-2024CVPR】Putting the Object Back into Video Object Segmentation
  • 掌握 C# 文件和输入输出操作
  • k8s 中的金丝雀发布(灰度发布)
  • 《IDEA:让编程效率翻倍的强大工具》
  • Docker 部署 Prometheus+Grafana 监控系统快速指南
  • No.8 笔记 | SQL 查询语句:数据探索的钥匙
  • 全局数据在Python包中模块间管理方法探讨