Open main menu
首页
专栏
课程
分类
归档
Chat
Sci-Hub
谷歌学术
Libgen
GitHub镜像
登录/注册
搜索
关闭
Previous
Previous
Next
Next
ChatGPT Web搭建
sockstack
/
227
/
2023-11-14 11:46:58
<p><span style="color: red; font-size: 18px">ChatGPT 可用网址,仅供交流学习使用,如对您有所帮助,请收藏并推荐给需要的朋友。</span><br><a href="https://ckai.xyz/?sockstack§ion=detail" target="__blank">https://ckai.xyz</a><br><br></p> <article class="_2rhmJa"><h3>实验环境:</h3> <p>系统版本:CentOS 7.9.2009<br> 终端软件:WindTerm_2.6.0</p> <h4>准备工作:</h4> <p>一个openai api key<br> 服务器需要能访问api.openai.com网络(建议购买国外VPS)</p> <p>安装Node.js</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-bash"><code class=" language-bash">cd /usr/local wget https://npmmirror.com/mirrors/node/v16.18.1/node-v16.18.1-linux-x64.tar.xz <span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 348px; background-color: transparent;"> <div class="image-container-fill" style="padding-bottom: 38.24%;"></div> <div class="image-view" data-width="910" data-height="348"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-a0e4c2f60be607cf.png" data-original-width="910" data-original-height="348" data-original-format="image/png" data-original-filesize="45398" data-image-index="0" style="cursor: zoom-in;" class="" src="//upload-images.jianshu.io/upload_images/25043306-a0e4c2f60be607cf.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/910/format/webp"></div> </div> <div class="image-caption">image.png</div> </div> <p>解压文件</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-css"><code class=" language-css">tar -xvf node-v16.18.1-linux-x64.tar.xz <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <p>重命名到nodejs</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-css"><code class=" language-css">mv node-v16.18.1-linux-x64 nodejs <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <p>创建Node.js软连接</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-bash"><code class=" language-bash">ln -s /usr/local/nodejs/bin/node /usr/bin ln -s /usr/local/nodejs/bin/npm /usr/bin ln -s /usr/local/nodejs/bin/npx /usr/bin <span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 555px; max-height: 62px;"> <div class="image-container-fill" style="padding-bottom: 11.17%;"></div> <div class="image-view" data-width="555" data-height="62"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-438c75f33dabd939.png" data-original-width="555" data-original-height="62" data-original-format="image/png" data-original-filesize="8537" data-image-index="1" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <br> <p>查看node版本号</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined">node -v <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 294px; max-height: 73px;"> <div class="image-container-fill" style="padding-bottom: 24.83%;"></div> <div class="image-view" data-width="294" data-height="73"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-61cbfd479da35268.png" data-original-width="294" data-original-height="73" data-original-format="image/png" data-original-filesize="3795" data-image-index="2" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <br> <p>安装PNPM</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined">npm install -g pnpm <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 396px; max-height: 173px;"> <div class="image-container-fill" style="padding-bottom: 43.69%;"></div> <div class="image-view" data-width="396" data-height="173"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-ae904e51c5d79a0f.png" data-original-width="396" data-original-height="173" data-original-format="image/png" data-original-filesize="8641" data-image-index="3" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <p>创建PNPM软连接</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-bash"><code class=" language-bash">ln -s /usr/local/nodejs/bin/pnpm /usr/bin ln -s /usr/local/nodejs/bin/pnpx /usr/bin <span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 542px; max-height: 69px;"> <div class="image-container-fill" style="padding-bottom: 12.73%;"></div> <div class="image-view" data-width="542" data-height="69"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-6928412fa0d2688b.png" data-original-width="542" data-original-height="69" data-original-format="image/png" data-original-filesize="7553" data-image-index="4" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <br> <p>查看PNPM版本号</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined">pnpm -v <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 267px; max-height: 56px;"> <div class="image-container-fill" style="padding-bottom: 20.97%;"></div> <div class="image-view" data-width="267" data-height="56"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-8a62c5bc7963ba93.png" data-original-width="267" data-original-height="56" data-original-format="image/png" data-original-filesize="3466" data-image-index="5" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <br> <p>安装Docker</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined">yum install -y yum-utils <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <p>设置镜像仓库源为阿里云</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-csharp"><code class=" language-csharp">yum<span class="token operator">-</span>config<span class="token operator">-</span>manager \ <span class="token operator">--</span><span class="token keyword">add</span><span class="token operator">-</span>repo \ http<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>mirrors<span class="token punctuation">.</span>aliyun<span class="token punctuation">.</span>com<span class="token operator">/</span>docker<span class="token operator">-</span>ce<span class="token operator">/</span>linux<span class="token operator">/</span>centos<span class="token operator">/</span>docker<span class="token operator">-</span>ce<span class="token punctuation">.</span>repo <span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre> </div> <p>更新软件包仓库索引</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined">yum makecache fast <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 288px;"> <div class="image-container-fill" style="padding-bottom: 32.21%;"></div> <div class="image-view" data-width="894" data-height="288"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-2528255de6e7c2df.png" data-original-width="894" data-original-height="288" data-original-format="image/png" data-original-filesize="26116" data-image-index="6" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <br> <p>安装decker社区版(期间需要手动输入两次Y)</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-css"><code class=" language-css">yum install docker-ce docker-ce-cli containerd.io <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 589px;"> <div class="image-container-fill" style="padding-bottom: 84.05%;"></div> <div class="image-view" data-width="903" data-height="759"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-c993ebc287784ca6.png" data-original-width="903" data-original-height="759" data-original-format="image/png" data-original-filesize="83750" data-image-index="7" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <p>查看docker版本</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined">docker version <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 203px;"> <div class="image-container-fill" style="padding-bottom: 25.19%;"></div> <div class="image-view" data-width="806" data-height="203"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-4376ce2f2ede19ac.png" data-original-width="806" data-original-height="203" data-original-format="image/png" data-original-filesize="17907" data-image-index="8" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <p>启动docker</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined">systemctl start docker <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 376px; max-height: 48px;"> <div class="image-container-fill" style="padding-bottom: 12.770000000000001%;"></div> <div class="image-view" data-width="376" data-height="48"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-64a0cc10cf8479a7.png" data-original-width="376" data-original-height="48" data-original-format="image/png" data-original-filesize="3096" data-image-index="9" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <br> <p>安装git</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined">yum install -y git <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 625px;"> <div class="image-container-fill" style="padding-bottom: 68.97999999999999%;"></div> <div class="image-view" data-width="906" data-height="625"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-5de8f2b95665ca3c.png" data-original-width="906" data-original-height="625" data-original-format="image/png" data-original-filesize="51260" data-image-index="10" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <br> <p>下载项目文件(连接失败或者超时的话需要魔法,多尝试几次也能成功)</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-php"><code class=" language-php">git <span class="token keyword">clone</span> https<span class="token punctuation">:</span><span class="token comment">//github.com/Chanzhaoyu/chatgpt-web.git</span> <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 685px; max-height: 159px;"> <div class="image-container-fill" style="padding-bottom: 23.21%;"></div> <div class="image-view" data-width="685" data-height="159"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-c786d5b53f01b9ac.png" data-original-width="685" data-original-height="159" data-original-format="image/png" data-original-filesize="16426" data-image-index="11" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <br> <p>在项目目录下的service/文件夹新建一个名为.env的文件</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-bash"><code class=" language-bash">cd ./chatgpt-web/service/ vi .env <span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre> </div> <p>输入一下内容</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined">OPENAI_API_KEY=你openai api key <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 451px; max-height: 71px;"> <div class="image-container-fill" style="padding-bottom: 15.740000000000002%;"></div> <div class="image-view" data-width="451" data-height="71"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-30574bf8b7c9bb19.png" data-original-width="451" data-original-height="71" data-original-format="image/png" data-original-filesize="5603" data-image-index="12" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <br> <div class="image-package"> <div class="image-container" style="max-width: 582px; max-height: 102px;"> <div class="image-container-fill" style="padding-bottom: 17.53%;"></div> <div class="image-view" data-width="582" data-height="102"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-4e015241887fc2a1.png" data-original-width="582" data-original-height="102" data-original-format="image/png" data-original-filesize="5546" data-image-index="13" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <br> <p>在chatgpt-web/service/目录下安装后端依赖</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined">pnpm install <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 605px;"> <div class="image-container-fill" style="padding-bottom: 67.75%;"></div> <div class="image-view" data-width="893" data-height="605"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-34484cf09059b142.png" data-original-width="893" data-original-height="605" data-original-format="image/png" data-original-filesize="46374" data-image-index="14" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <p>在chatgpt-web/目录下安装前端依赖</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined">pnpm bootstrap <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 886px;"> <div class="image-container-fill" style="padding-bottom: 126.57000000000001%;"></div> <div class="image-view" data-width="907" data-height="1148"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-7ed944775942332e.png" data-original-width="907" data-original-height="1148" data-original-format="image/png" data-original-filesize="89247" data-image-index="15" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <br> <p>打包项目</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined">docker build -t chatgpt-web . <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 608px;"> <div class="image-container-fill" style="padding-bottom: 86.72%;"></div> <div class="image-view" data-width="911" data-height="790"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-7e035016edf442c5.png" data-original-width="911" data-original-height="790" data-original-format="image/png" data-original-filesize="108808" data-image-index="16" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <br> <p>运行项目</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined">docker run --name chatgpt-web -d -p 3002:3002 --env OPENAI_API_KEY= 你的openai api key chatgpt-web <span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 80px;"> <div class="image-container-fill" style="padding-bottom: 8.81%;"></div> <div class="image-view" data-width="908" data-height="80"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-062c2dee4c7d7538.png" data-original-width="908" data-original-height="80" data-original-format="image/png" data-original-filesize="11922" data-image-index="17" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> <br> <p>测试(服务器IP加端口号)</p> <div class="_2Uzcx_"> <button class="VJbwyy" type="button" aria-label="复制代码"><i aria-label="icon: copy" class="anticon anticon-copy"><svg viewbox="64 64 896 896" focusable="false" class="" data-icon="copy" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"></path></svg></i></button><pre class="line-numbers language-undefined"><code class=" language-undefined"></code></pre> </div> <div class="image-package"> <div class="image-container" style="max-width: 700px; max-height: 423px;"> <div class="image-container-fill" style="padding-bottom: 60.419999999999995%;"></div> <div class="image-view" data-width="1920" data-height="1160"><img referrerpolicy="no-referrer" data-original-src="//upload-images.jianshu.io/upload_images/25043306-a9adfa989d1cc961.png" data-original-width="1920" data-original-height="1160" data-original-format="image/png" data-original-filesize="48061" data-image-index="18" style="cursor: zoom-in;" class="image-loading"></div> </div> <div class="image-caption">image.png</div> </div> </article>
ChatGPT Web搭建
作者
sockstack
许可协议
CC BY 4.0
发布于
2023-11-14
修改于
2024-12-22
上一篇:软件:常用 Linux 软件汇总,值得收藏
下一篇:在云服务器上搭建个人版chatGPT及后端Spring Boot集成chat GPT
尚未登录
登录 / 注册
文章分类
博客重构之路
5
Spring Boot简单入门
4
k8s 入门教程
0
MySQL 知识
1
NSQ 消息队列
0
ThinkPHP5 源码分析
5
使用 Docker 从零开始搭建私人代码仓库
3
日常开发汇总
4
标签列表
springboot
hyperf
swoole
webman
php
多线程
数据结构
docker
k8s
thinkphp
mysql
tailwindcss
flowbite
css
前端