docker 运行jenkins及vue项目与springboot项目:

准备配置

创建 /home/docker/nginx/nginx.conf 文件及/home/docker/nginx/log文件夹

其nginx.conf 文件为在原nginx.conf上添加上自定义的一些配置

#user  nobody;
worker_processes 1; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections 1024;
} http {
include mime.types;
default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout 0;
keepalive_timeout 65; #gzip on;
#
upstream blog {
server localhost:8089;
#hash $remote_addr;
#check interval=3000 rise=2 fall=5 timeout=1000 type=http;
#check_http_send "HEAD /mwmonitor/check.jsp HTTP/1.0\r\n\r\n";
# check_http_expect_alive http_2xx http_3xx;
# #keepalive 60;
# ip_hash;
} server {
listen 80;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root /var/web/www;
try_files $uri $uri/ /index.html last;
index index.html index.htm;
# error_page 405 =200 http://$host$request_uri;
} location /blog {
proxy_pass http://blog;
} #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 html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
} # another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost; # ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#} }
运行命令

若没有镜像则会自动pull镜像

docker run -p 8080:80 -v /home/docker/nginx/nginx.conf:/etc/nginx/nginx.conf -v /home/docker/nginx/log:/var/log/nginx -v /home/docker/jenkins/jenkins_home/www:/var/web/www -d docker.io/nginx

其中:

-p 8080:80 将8080端口映射至docker的80端口

-v /home/docker/nginx/nginx.conf:/etc/nginx/nginx.conf 配置映射:服务器中的nginx配置映射至容器的nginx配置中

-v /home/docker/nginx/log:/var/log/nginx 日志映射

-v /home/docker/jenkins/jenkins_home/www:/var/web/www 网页文件映射:jenkins打包后的web页面文件夹映射至nginx配置的web文件夹(在配置文件中注意更改location /{root /var/web/www; ...})

访问http://192.168.37.136:8080即可看到jenkins打包的git项目后的页面

docker 运行jenkins及vue项目与springboot项目(四.docker运行nginx)的更多相关文章

  1. docker 运行jenkins及vue项目与springboot项目(三.jenkins的使用及自动打包vue项目)

    docker 运行jenkins及vue项目与springboot项目: 一.安装docker 二.docker运行jenkins为自动打包运行做准备 三.jenkins的使用及自动打包vue项目 四 ...

  2. docker 运行jenkins及vue项目与springboot项目(一.安装docker)

    docker 运行jenkins及vue项目与springboot项目: 一.安装docker 二.docker运行jenkins为自动打包运行做准备 三.jenkins的使用及自动打包vue项目 四 ...

  3. docker 运行jenkins及vue项目与springboot项目(二.docker运行jenkins为自动打包运行做准备)

    docker 运行jenkins及vue项目与springboot项目: 一.安装docker 二.docker运行jenkins为自动打包运行做准备 三.jenkins的使用及自动打包vue项目 四 ...

  4. docker 运行jenkins及vue项目与springboot项目(五.jenkins打包springboot服务且在docker中运行)

    docker 运行jenkins及vue项目与springboot项目: 一.安装docker 二.docker运行jenkins为自动打包运行做准备 三.jenkins的使用及自动打包vue项目 四 ...

  5. Docker运行mysql,redis,oracle容器和SpringBoot项目

    dokcer运行SpringBoot项目 from frolvlad/alpine-oraclejdk8:slim VOLUME /tmp ADD target/demo-0.0.1-SNAPSHOT ...

  6. Docker学习笔记五:Docker生成jenkins容器,支持Java Web项目持续集成、持续部署

    一.创建jenkins容器: 1.拉取jeknin镜像 sudo docker pull jenkins 2.创建一个jenkins目录 sudo mkdir /jenkins 3.在jenkins目 ...

  7. 利用Jenkins实现jdk11+Maven构建springboot项目

    目录 原理图 前期准备 Jdk11安装 Jenkins安装 Maven安装 Jenkins的设置 插件安装 变量配置 搭建项目 1.通用配置 2.源码管理 3.构建触发 4.Maven的构建选项 5. ...

  8. springboot核心技术(四)-----Docker、数据访问、自定义starter

    Docker 1.简介 Docker是一个开源的应用容器引擎:是一个轻量级容器技术: Docker支持将软件编译成一个镜像:然后在镜像中各种软件做好配置,将镜像发布出去,其他使用者可以直接使 用这个镜 ...

  9. 怒改springMVC项目为springBoot项目

    背景:公司最近在做项目升级,融合所有项目,但是目前使用的一个系统还是最原始的框架 springMVC+spring+mybatis ,前端还是jsp,easyui(技术老的掉牙),终于出手了,结果.. ...

随机推荐

  1. Echarts--Y坐标标题显示不全

    如:下图,Y坐标标题显示不全 y2可以控制不显示区域的高度,就能显示全啦 grid:{ x:40, x2:100, y2:200 }

  2. 【优化】MySQL千万级大表优化解决方案

    问题概述 使用阿里云rds for MySQL数据库(就是MySQL5.6版本),有个用户上网记录表6个月的数据量近2000万,保留最近一年的数据量达到4000万,查询速度极慢,日常卡死.严重影响业务 ...

  3. Oracle分组函数之ROLLUP

    功能介绍: 首先是进行无字段的聚合,然后在对字段进行从左到右依次组合后聚合 创建表: Create Table score ( classID Int, studentName ), subject ...

  4. JS在页面加载之后运行

    通用的页面加载后再运行JS有两种方式:1.在DOM加载完毕后,页面全部内容(如图片等)完全加载完毕前运行JS.   2.在页面全部内容加载完成(包括引用文件,图片等)之后再加载JS 1.在DOM加载后 ...

  5. kafka-consumer.properties

    # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreement ...

  6. 前端每日实战:24# 视频演示如何用纯 CSS 创作出平滑的层叠海浪特效

    效果预览 按下右侧的"点击预览"按钮可以在当前页面预览,点击链接可以全屏预览. https://codepen.io/comehope/pen/JvmBdE 可交互视频教程 此视频 ...

  7. 剑指offer---4、序列化二叉树

    剑指offer---4.序列化二叉树 一.总结 一句话总结: 1. 对于序列化:使用前序遍历,递归的将二叉树的值转化为字符,并且在每次二叉树的结点不为空时,在转化val所得的字符之后添加一个' , ' ...

  8. 109、TensorFlow计算张量的值

    # 当计算图创建成功时 # 你就可以运行这个计算图,然后生成一个新的张量 # 并且得到这个张量指向的计算图中具体的数值 #这个功能在debug的时候非常有必要 #最简单获得张量具体值的方法是使用Ten ...

  9. Ubuntu18.10 编译libevent出现错误: creating symbolic link XXXXXX : Operation not supported

    今天在VirtualBox虚拟机下的Ubuntu18.10编译libevent源代码时,按照github中使用cmake方式: $ mkdir build && cd build $ ...

  10. [Fw]初探linux中断系统(1)

    1. 重要接口 LDD上说,“内核维护了一个中断信号线的注册表,该注册表类似于I/O端口的注册表.模块在使用中断前要先请求一个中断通道(或者中断请求IRQ),然后在使用后释放该通道.” 撇开系统如何遍 ...