banner
Geek

Geek

🧠在家居士 | 🥦素食者 | 🏃🏻马拉松爱好者 | 📡AI降临派 | 过🪜技术资深学者 | 🤖科技狂 | 📤更新狂🆅 https://www.igeekbb.com/
twitter
github

How to Deploy Chatbot UI Locally for Beginners

The previously introduced Chatbot UI has been mentioned before, and now it is also the main force of my ChatGPT web end. I used to deploy it with one click on Vercel, as recommended on the project homepage of Github. However, recently Vercel has seen an increasing number of users, causing the page loading to become slow, affecting the user experience. In order to see if it can be deployed on my own VPS or locally, I have recorded the deployment process.


VPS Deployment (Incomplete)#

  • First, I installed various dependencies and environments on the VPS according to the project instructions, and ran
 docker build -t chatgpt-ui .
  • Then the whole world became quiet, and I punished myself with a glass of wine for my naive behavior.
image image
  • I'll get a more powerful VPS later? 😅

Local Deployment#

NameConfiguration
Mac OSVentura 13.3.1
Dockerversion 23.0.3

Open Terminal#

Install Docker for ChatGPT by yourself. My Docker projects are all stored in the "Documents" folder, i.e., /Users/geek/Documents/docker

Go to the docker folder in the terminal#
   cd /Users/geek/Documents/docker 
Clone the chatbot-ui project to your local machine#
git clone https://github.com/mckaywrigley/chatbot-ui.git
Go into the chatbot-ui folder#
 cd chatbot-ui 
Run the following command to build the Docker image:#
docker build -t chatbot-ui .
  • If the build is successful, you will see the following prompt: *If it fails, ask ChatGPT 😂

=> [production 8/8] COPY --from=build /app/next-i18next.config.js ./next 0.0s
=> exporting to image 10.3s
=> => exporting layers 10.3s
=> => writing image sha256.0s
=> => naming to docker.io/library/chatbot-ui

Run Docker#
  • Replace xxxxxxxx with your OpenAI API key
docker run -e OPENAI_API_KEY=xxxxxxxx -p 3000:3000 chatbot-ui

  • To change the docker container from foreground mode to background mode, use the following command:
docker run -d -e OPENAI_API_KEY=xxxxxxxx -p 3000:3000 chatbot-ui
  • In this command, we added a -d flag, which stands for detached mode. This will make the Docker container run in the background instead of the foreground.

  • Additionally, if you need to name the container, you can use the --name flag to specify a name, for example:
docker run -d --name my-container -e OPENAI_API_KEY=xxxxxxxx -p 3000:3000 chatbot-ui
  • This will name the container as my-container.

Open the browser (Done)🎉#

http://127.0.0.1:3000/

CleanShot 2023-04-14 at 13.23.15@2x.png

Note: I use a whitelist to access the Internet with a software router. This is for use in the domestic environment. Please research chatgptProxyAPI on your own.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.