You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xzs-mysql/docs/guide/deploy.html

33 lines
23 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="generator" content="VuePress 2.0.0-beta.25">
<link rel="icon" href="https://www.mindskip.net/style/images/favicon.png"><title>6. 项目部署 | 学之思教程</title><meta name="description" content="学之思开发部署教程">
<link rel="preload" href="/xzs-mysql/assets/js/runtime~app.f14c4573.js" as="script"><link rel="preload" href="/xzs-mysql/assets/css/styles.da5c9ac6.css" as="style"><link rel="preload" href="/xzs-mysql/assets/js/812.fc3c1ea3.js" as="script"><link rel="preload" href="/xzs-mysql/assets/js/app.2f385571.js" as="script">
<link rel="stylesheet" href="/xzs-mysql/assets/css/styles.da5c9ac6.css">
</head>
<body>
<div id="app"><!--[--><div class="theme-container"><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/xzs-mysql/" class=""><img class="logo" src="/xzs-mysql/images/logo/logo.png" alt="学之思教程"><span class="site-name can-hide">学之思教程</span></a></span><div class="navbar-links-wrapper" style=""><!--[--><!--]--><nav class="navbar-links can-hide"><!--[--><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net" rel="noopener noreferrer" target="_blank" aria-label="官网"><!--[--><!--]--> 官网 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/sdd.html" rel="noopener noreferrer" target="_blank" aria-label="思多多"><!--[--><!--]--> 思多多 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/wdd.html" rel="noopener noreferrer" target="_blank" aria-label="维多多"><!--[--><!--]--> 维多多 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/xzs.html" rel="noopener noreferrer" target="_blank" aria-label="学之思"><!--[--><!--]--> 学之思 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/buy.html" rel="noopener noreferrer" target="_blank" aria-label="商业购买"><!--[--><!--]--> 商业购买 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-dark-button" title="toggle dark mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><!----></div></header><div class="sidebar-mask"></div><aside class="sidebar"><nav class="navbar-links"><!--[--><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net" rel="noopener noreferrer" target="_blank" aria-label="官网"><!--[--><!--]--> 官网 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/sdd.html" rel="noopener noreferrer" target="_blank" aria-label="思多多"><!--[--><!--]--> 思多多 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/wdd.html" rel="noopener noreferrer" target="_blank" aria-label="维多多"><!--[--><!--]--> 维多多 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/xzs.html" rel="noopener noreferrer" target="_blank" aria-label="学之思"><!--[--><!--]--> 学之思 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><div class="navbar-links-item"><a class="nav-link external" href="https://www.mindskip.net/buy.html" rel="noopener noreferrer" target="_blank" aria-label="商业购买"><!--[--><!--]--> 商业购买 <span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-links"><!--[--><!--[--><a href="/xzs-mysql/guide/feature.html" class="nav-link sidebar-heading sidebar-item" aria-label="1. 功能列表"><!--[--><!--]--> 1. 功能列表 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/xzs-mysql/guide/skill.html" class="nav-link sidebar-heading sidebar-item" aria-label="2. 技术栈"><!--[--><!--]--> 2. 技术栈 <!--[--><!--]--></a><!----><!--]--><!--[--><a href="/xzs-mysql/guide/database.html" class="nav-link sidebar-heading sidebar-item" aria-label="3. 数据库设计"><!--[--><!--]--> 3. 数据库设计 <!--[--><!--]--></a><!----><!--]--><!--[--><p class="sidebar-heading sidebar-item">4. 接口文档</p><ul class=""><li><!--[--><a href="/xzs-mysql/guide/student.html" class="nav-link sidebar-item" aria-label="4.1 学生端"><!--[--><!--]--> 4.1 学生端 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a href="/xzs-mysql/guide/wx.html" class="nav-link sidebar-item" aria-label="4.2 小程序"><!--[--><!--]--> 4.2 小程序 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a href="/xzs-mysql/guide/admin.html" class="nav-link sidebar-item" aria-label="4.3 管理端"><!--[--><!--]--> 4.3 管理端 <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--><!--[--><a href="/xzs-mysql/guide/develop.html" class="nav-link sidebar-heading sidebar-item" aria-label="5. 项目开发"><!--[--><!--]--> 5. 项目开发 <!--[--><!--]--></a><!----><!--]--><!--[--><a aria-current="page" href="/xzs-mysql/guide/deploy.html" class="router-link-active router-link-exact-active nav-link router-link-active sidebar-heading sidebar-item active" aria-label="6. 项目部署"><!--[--><!--]--> 6. 项目部署 <!--[--><!--]--></a><ul class=""><li><!--[--><a aria-current="page" href="/xzs-mysql/guide/deploy.html#_6-1-集成部署" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="6.1 集成部署"><!--[--><!--]--> 6.1 集成部署 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/xzs-mysql/guide/deploy.html#_6-2-前后端分离部署" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="6.2 前后端分离部署"><!--[--><!--]--> 6.2 前后端分离部署 <!--[--><!--]--></a><!----><!--]--></li><li><!--[--><a aria-current="page" href="/xzs-mysql/guide/deploy.html#_6-3-docker部署" class="router-link-active router-link-exact-active nav-link sidebar-item" aria-label="6.3 docker部署"><!--[--><!--]--> 6.3 docker部署 <!--[--><!--]--></a><!----><!--]--></li></ul><!--]--><!--[--><a href="/xzs-mysql/guide/video.html" class="nav-link sidebar-heading sidebar-item" aria-label="7. 视频教程"><!--[--><!--]--> 7. 视频教程 <!--[--><!--]--></a><!----><!--]--><!--]--></ul><!--[--><!--]--></aside><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><h1 id="_6-项目部署" tabindex="-1"><a class="header-anchor" href="#_6-项目部署" aria-hidden="true">#</a> 6. 项目部署</h1><h3 id="_6-1-集成部署" tabindex="-1"><a class="header-anchor" href="#_6-1-集成部署" aria-hidden="true">#</a> 6.1 集成部署</h3><ul><li>分别在\source\vue\xzs-student目录和source\vue\xzs-admin目录执行前端打包命令</li></ul><div class="language-npm ext-npm line-numbers-mode"><pre class="language-npm"><code>npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/
npm install --registry https://registry.npm.taobao.org
npm run build
</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div><ul><li>打包后的目录为student和admin</li><li>将文件放到\source\xzs\src\main\resources\static下然后将java程序打包成jar包</li><li>修改application-prod.yml中的datasource地址</li><li>学生端访问地址为:<a href="http://ip:8000/student" target="_blank" rel="noopener noreferrer">http://ip:8000/student<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a></li><li>管理员端访问地址为:<a href="http://ip:8000/admin" target="_blank" rel="noopener noreferrer">http://ip:8000/admin<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a></li><li>执行下列命令,运行程序</li></ul><div class="language-java ext-java line-numbers-mode"><pre class="language-java"><code>nohup java <span class="token operator">-</span><span class="token class-name">Duser</span><span class="token punctuation">.</span>timezone<span class="token operator">=</span><span class="token class-name">Asia</span><span class="token operator">/</span><span class="token class-name">Shanghai</span> <span class="token operator">-</span>jar <span class="token operator">-</span><span class="token class-name">Dspring</span><span class="token punctuation">.</span>profiles<span class="token punctuation">.</span>active<span class="token operator">=</span>prod xzs<span class="token operator">-</span><span class="token number">3.5</span><span class="token number">.0</span><span class="token punctuation">.</span>jar <span class="token operator">&gt;</span> start1<span class="token punctuation">.</span>log <span class="token number">2</span><span class="token operator">&gt;</span><span class="token operator">&amp;</span><span class="token number">1</span> <span class="token operator">&amp;</span>
</code></pre><div class="line-numbers"><span class="line-number">1</span><br></div></div><h3 id="_6-2-前后端分离部署" tabindex="-1"><a class="header-anchor" href="#_6-2-前后端分离部署" aria-hidden="true">#</a> 6.2 前后端分离部署</h3><ul><li>采用前后端分离方式部署后端启动和部署方式1一样</li><li>前端采用nginx来装载静态页面,先创建/usr/local/xzs/web/目录然后将打包后的student、admin放到此目录下</li><li>页面访问端口为8001注意检查防火墙端口是否打开</li><li>学生端访问地址为:<a href="http://ip:8001/student" target="_blank" rel="noopener noreferrer">http://ip:8001/student<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a></li><li>管理员端访问地址为:<a href="http://ip:8001/admin" target="_blank" rel="noopener noreferrer">http://ip:8001/admin<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a></li><li>nginx配置如下</li></ul><div class="language-nginx ext-nginx line-numbers-mode"><pre class="language-nginx"><code><span class="token directive"><span class="token keyword">server</span></span> <span class="token punctuation">{</span>
<span class="token directive"><span class="token keyword">listen</span> <span class="token number">8001</span></span><span class="token punctuation">;</span>
<span class="token directive"><span class="token keyword">server_name</span> xzs</span><span class="token punctuation">;</span>
<span class="token directive"><span class="token keyword">location</span> /</span> <span class="token punctuation">{</span>
<span class="token directive"><span class="token keyword">root</span> /usr/local/xzs/web/</span><span class="token punctuation">;</span>
<span class="token directive"><span class="token keyword">index</span> index.html</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token directive"><span class="token keyword">location</span> /api/</span> <span class="token punctuation">{</span>
<span class="token directive"><span class="token keyword">proxy_pass</span> http://localhost:8000</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br></div></div><h3 id="_6-3-docker部署" tabindex="-1"><a class="header-anchor" href="#_6-3-docker部署" aria-hidden="true">#</a> 6.3 docker部署</h3><ul><li>准备好centos服务器</li><li>先检查服务器端口、ip转发的是否配置正确否则无法访问到docker内部</li><li>docker内部镜像已经安装了java、mysql,均已配置好,无需其他操作</li><li>执行下列docker命令拉取镜像启动容器</li><li>学生端访问地址为:<a href="http://ip:8000/student" target="_blank" rel="noopener noreferrer">http://ip:8000/student<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a></li><li>管理员端访问地址为:<a href="http://ip:8000/admin" target="_blank" rel="noopener noreferrer">http://ip:8000/admin<span><svg class="icon outbound" xmlns="http://www.w3.org/2000/svg" ariahidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><!--[--><span class="sr-only">open in new window</span><!--]--></span></a></li></ul><div class="language-docker ext-docker line-numbers-mode"><pre class="language-docker"><code>docker pull registry.cn-hangzhou.aliyuncs.com/mindskip/xzs:v3.8.0
docker run -d --name xzs --privileged -it -d -p 8000:8000 -v /etc/localtime:/etc/localtime:ro registry.cn-hangzhou.aliyuncs.com/mindskip/xzs:v3.8.0 /usr/sbin/init
</code></pre><div class="line-numbers"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><!--]--></div><footer class="page-meta"><!----><div class="meta-item last-updated"><span class="meta-item-label">上次更新: </span><span class="meta-item-info">2022/7/14 13:59:24</span></div><!----></footer><nav class="page-nav"><p class="inner"><span class="prev"><a href="/xzs-mysql/guide/develop.html" class="nav-link" aria-label="5. 项目开发"><!--[--><!--]--> 5. 项目开发 <!--[--><!--]--></a></span><span class="next"><a href="/xzs-mysql/guide/video.html" class="nav-link" aria-label="7. 视频教程"><!--[--><!--]--> 7. 视频教程 <!--[--><!--]--></a></span></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
<script src="/xzs-mysql/assets/js/runtime~app.f14c4573.js" defer></script><script src="/xzs-mysql/assets/js/812.fc3c1ea3.js" defer></script><script src="/xzs-mysql/assets/js/app.2f385571.js" defer></script>
</body>
</html>