nginx使用:
ubuntu系统安装nginx
apt install nginx
nginx的主配置文件
nginx.conf
nginx的子配置文件
conf.d里创建XXX.conf
nginx模块
全局块,events块,http全局块,http应用块,多个server块(虚拟主机),多个location(路由)
docker部署springboot项目
idea上点击maven->双击package,打包成jar包
jar包上传云服务器
制作Dockerfile文件
将Dockerfile文件与jar包放于同一目录下
进入上级目录,使用命令docker -t 镜像名:标签 目录 (创建镜像)
docker images查看镜像
docker run -d -p 端口:端口 镜像名:标签 (创建容器并运行)
开放服务器防火墙端口和docker环境端口
firewall-cmd --zone=public --add-port=8080/tcp --permanent
//开放服务器端口
firewall-cmd --zone=docker --add-port=8080/tcp --permanent
//开放docker环境端口