首页 > 编程知识 正文

docker与微服务,docker运行在虚拟机上

时间:2023-05-05 22:23:40 阅读:26091 作者:3649

安装经纪人

//docker安装在yum-yinstallyum-utils device-mapper-persistent-datalvm2container-selinux/docker库yum-config-manager-- add-repo http://mirrors.a liyun.com/docker-ce/Linux/centos/docker-ce.repe 设置yum list installed | grep docker//启动时的自启动,以确定是否成功安装了配置的docker,以及dockersystemctlenabledocker//docker服务systemctl 确定是否启动的systemctl status docker//docker缺省网桥172.17.0.12.Ruoyi微服务jar包,然后将127.0.0.1:8848发送到

3.Xftp创建/usr/local/ruoyi文件夹,创建系统、auth和网关三个子文件夹,然后上传jar包

创建docker文件。 内容如下。 分配并重命名三个子文件夹

from Java :8 addruoyi-auth-2.4.0.jar auth.jar entry point [ ' Java '、'-jar '、' auth.jar']5.docker镜像

CD/usr/local/ruoyi/authdockerbuild-tauth.CD/usr/local/ruoyi/gatewaydockerbuild-tgateway.CD/usr/lockerd

docker run-d-p 920133609201 systemdockerrun-d-p 920033609200 authdockerrun-d-p 8080:8080网关7.xftp新建/usr/lasask

将nginx.conf修改如下

工作器_ processes 1; 事件{ worker _ connections 1024; }http { include mime.types; efault _ type应用程序/octet-stream; sendfile on; keepalive_timeout 65; 服务器{ listen 80; server_name localhost; 位置/{ root/usr/local/ruoyi/ui/dist; try_files $uri $uri//index.html; 索引索引. html index.htm; } location/prod-API/{ proxy _ set _ header host $ http _ host; proxy _ set _ headerx-real-IP $ remote _ addr; proxy _ set _ header remote-host $ remote _ addr; proxy _ set _ headerx-forwarded-for $ proxy _ add _ x _ forwarded _ for; proxy _ pass http://localhost :8080/} error _ page 500502503504/50x.html; location=/50x.html { root html; 重新启动nginx并正常使用

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。