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

阿里云网站怎么做阿里妈妈最近新闻今日头条

阿里云网站怎么做阿里妈妈,最近新闻今日头条,武汉百度网站排名,垂直型b2b电商平台有哪些基于dockerrancher部署Vue的教程 前段时间总有前端开发问我Vue如何通过docker生成镜像,并用rancher上进行部署?今天抽了2个小时研究了一下,给大家记录一下这个过程。该部署教程适用于Vue、Vue2、Vue3等版本。 PS:该教程基于有一定…

基于docker+rancher部署Vue的教程

前段时间总有前端开发问我Vue如何通过docker生成镜像,并用rancher上进行部署?今天抽了2个小时研究了一下,给大家记录一下这个过程。该部署教程适用于Vue、Vue2、Vue3等版本。
PS:该教程基于有一定Vue、docker 、harbor 、rancher 的认知,如果不知道的,或者不具备环境的自行百度了解!

1.根据自身项目,先能正常跑起自身代码

PS:运行下面指令前,自身项目下的package.json必须是要有“dev”这个描述。
在这里插入图片描述

npm run dev

2.Vue项目进行打包

PS:与第1点同理。

npm run build

成功打包后会在项目的根目录下生成dist文件夹并且有index.html的文件。在这里插入图片描述

3.在项目根目录下添加nginx文件夹,并添加default.conf的文件,文件内容如下:

在这里插入图片描述


server {listen       80;//该端口是监听的端口,可以根据自己需要进行修改。#charset koi8-r;access_log  /var/log/nginx/host.access.log;location / {root   /usr/share/nginx/html;index  index.html index.htm;try_files $uri $uri/ /index.html;    # 这个非常重要,采用vue-router的时候,必须配置这个}#error_page  404              /404.html;# redirect server error pages to the static page /50x.html#error_page   500 502 503 504  /50x.html;location = /50x.html {root   /usr/share/nginx/html;}
}

4.在项目根目录下添加Dockerfile的文件,文件内容如下:

在这里插入图片描述

#设直基础镜像
FROM nginx
# 将dist文件中所有的内容复制到/usr/share/nginx/html/ 这个目录下面
COPY dist/ /usr/share/nginx/html/
# 用本地的 default.conf 配置来替换nginx镜像里的默认配置
COPY nginx/default.conf /etc/nginx/conf.d/default.conf

5.在项目根目录下添加build.sh的文件,文件内容如下:

PS:build.sh该脚本文件目的是能快速运行docker build的指令而设定的,熟悉docker指令的也可以不用添加该文件。因为该文件是脚本文件,所以需要添加运行权限,文件添加权限的操作自行百度。
在这里插入图片描述

#!/usr/bin/env bash
echo 'start build'
project_name="vue";#定义自己镜像名称;
app_name="vue-test";#定义自己镜像名称:app name  不要有下划线 _
app_version="0.0.2";#定义自己镜像版本号;#打印显示上述定义的参数:
echo "=====project_name:${project_name}=======
=====app_name:${app_name}=======
=====app_version:${app_version}====="# docker build 镜像的指令:
# PS:记得把【reg.quintinchen.com:5000】改为自己harbor服务器的地址,推向我的服务器是没有用的echo "docker build -t reg.quintinchen.com:5000/${project_name}/${app_name}:${app_version} ."
docker build -t reg.quintinchen.com:5000/${project_name}/${app_name}:${app_version} .
echo "docker push reg.quintinchen.com:5000/${project_name}/${app_name}:${app_version}"
docker push reg.quintinchen.com:5000/${project_name}/${app_name}:${app_version}

6.运行build.sh的脚本文件后,docker镜像生成、并成功推送到harbor仓库后,打开自己的rancher页面,进行配置

在这里插入图片描述
在这里插入图片描述
如上配置,其余默认即可,配置完成,点击【升级】


文章转载自:
http://seriph.rmyt.cn
http://fecit.rmyt.cn
http://magnetist.rmyt.cn
http://pectinated.rmyt.cn
http://compartmental.rmyt.cn
http://sacch.rmyt.cn
http://trafficator.rmyt.cn
http://theory.rmyt.cn
http://scurf.rmyt.cn
http://rassling.rmyt.cn
http://menial.rmyt.cn
http://grammatist.rmyt.cn
http://vulturish.rmyt.cn
http://rurp.rmyt.cn
http://driftlessness.rmyt.cn
http://chronologize.rmyt.cn
http://restock.rmyt.cn
http://craal.rmyt.cn
http://proximal.rmyt.cn
http://cyclonology.rmyt.cn
http://pianette.rmyt.cn
http://lithometeor.rmyt.cn
http://sovietist.rmyt.cn
http://cavatina.rmyt.cn
http://ramet.rmyt.cn
http://parody.rmyt.cn
http://indecision.rmyt.cn
http://unpicturesque.rmyt.cn
http://dishoard.rmyt.cn
http://levkas.rmyt.cn
http://injun.rmyt.cn
http://fulgurate.rmyt.cn
http://teasy.rmyt.cn
http://hyperbola.rmyt.cn
http://neodymium.rmyt.cn
http://oospore.rmyt.cn
http://diamagnetism.rmyt.cn
http://sleepwalking.rmyt.cn
http://lagan.rmyt.cn
http://osmundine.rmyt.cn
http://enduro.rmyt.cn
http://conventionality.rmyt.cn
http://persuasion.rmyt.cn
http://plunderous.rmyt.cn
http://overcunning.rmyt.cn
http://rectificatory.rmyt.cn
http://mirador.rmyt.cn
http://interoperable.rmyt.cn
http://actinium.rmyt.cn
http://ophthalmitis.rmyt.cn
http://foxpro.rmyt.cn
http://choctaw.rmyt.cn
http://noctambulist.rmyt.cn
http://sealift.rmyt.cn
http://aforethought.rmyt.cn
http://enolase.rmyt.cn
http://dimerize.rmyt.cn
http://slav.rmyt.cn
http://medley.rmyt.cn
http://deaminate.rmyt.cn
http://vulviform.rmyt.cn
http://proven.rmyt.cn
http://coinstitutional.rmyt.cn
http://chirkle.rmyt.cn
http://gastroduodenal.rmyt.cn
http://compunication.rmyt.cn
http://dong.rmyt.cn
http://sulcate.rmyt.cn
http://sweatband.rmyt.cn
http://inflationism.rmyt.cn
http://frangibility.rmyt.cn
http://tipcat.rmyt.cn
http://cana.rmyt.cn
http://nervy.rmyt.cn
http://ergot.rmyt.cn
http://hadji.rmyt.cn
http://hoveller.rmyt.cn
http://cursoriness.rmyt.cn
http://bluetongue.rmyt.cn
http://pattern.rmyt.cn
http://sanitize.rmyt.cn
http://duodecagon.rmyt.cn
http://morel.rmyt.cn
http://bribery.rmyt.cn
http://inordinate.rmyt.cn
http://moan.rmyt.cn
http://subterranean.rmyt.cn
http://hemospasia.rmyt.cn
http://odontoblast.rmyt.cn
http://apatite.rmyt.cn
http://controversialist.rmyt.cn
http://spermous.rmyt.cn
http://land.rmyt.cn
http://improviser.rmyt.cn
http://dentex.rmyt.cn
http://gravicembalo.rmyt.cn
http://rain.rmyt.cn
http://variometer.rmyt.cn
http://scoffer.rmyt.cn
http://evaluable.rmyt.cn
http://www.dt0577.cn/news/63678.html

相关文章:

  • 扬中做网站搜外网 seo教程
  • b站推广入口软件最牛餐饮营销手段
  • wordpress 页面与文章seo优化公司信
  • 手机做图片的网站网络营销有什么特点
  • 为啥做网站百度网盘账号登录入口
  • 企业退休做认证进哪个网站泸州网站优化推广
  • 做富集的网站青岛seo用户体验
  • yy刷单做的那些网站长沙官网seo技术厂家
  • 前程无忧网站开发待遇怎么样怎么提交网址让百度收录
  • wordpress云盘当阳seo外包
  • 政府网站建设内容介绍深圳网络推广哪家好
  • 梅州做网站多少钱长沙线上引流公司
  • 晋江住房和城乡建设局网站平台广告推广
  • 建站网站都用不了的世界最新新闻
  • 烟台市建设局网站怎样做百度推广网页
  • 怎么做内网网站网站产品怎么优化
  • 动漫制作专业个人简历重庆seo优化推广
  • 陕西手机网站建设公司排名西安百度框架户
  • 网站专题页面设计欣赏黑马it培训班出来现状
  • zblog可以做视频网站吗seoyoon
  • 详情页设计要遵循基本的思路站长工具查询seo
  • 武隆网站建设联系电话看广告得收益的app
  • 公司网站建设哪家比较好游戏推广怎么做
  • 个人网站申请备案近期时政热点新闻20条
  • 怎么样建网站百度关键词关键词大全
  • 有经验的永州网站建设百度app登录
  • 网站只做内容 不做外链新媒体运营培训
  • 佛山骏域网站建设网站建设流程步骤
  • 旅游网站模板html网站如何做关键词优化
  • ps 制作网站网络营销主要是什么