The previously introduced Chatbot UI has been mentioned before, and now it is also the main component of my ChatGPT web application. I usually use the one-click deployment recommended on the project homepage of Github to deploy it on Vercel. However, recently Vercel has been experiencing slower page loading due to an increasing number of users, which affects the user experience. In order to see if it can be deployed on my own VPS or locally, I am documenting my deployment process.
Name | Address |
---|---|
Chatbot UI | https://github.com/mckaywrigley/chatbot-ui |
VPS Deployment (Incomplete)#
- First, I installed all the dependencies and environment required by the project on the VPS, and then ran the command:
docker build -t chatgpt-ui .
- Then the whole world went quiet, and I punished myself with a glass of wine for my ignorance.
- Maybe I should get a more powerful VPS? 😅
Local Deployment#
Name | Configuration |
---|---|
Mac OS | Ventura 13.3.1 |
Docker | version 23.0.3 |
Open Terminal#
Make sure you have Docker installed for ChatGPT. My Docker projects are stored in the "Documents" folder, which is located at: /Users/geek/Documents/docker
Navigate 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
Navigate to 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 for help. 😂
=> [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 the -d flag, which represents detached mode. This will run the Docker container in the background instead of the foreground.
- Additionally, if you want 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/
Note: I am using a whitelist for internet access through a software router. This is for use in a domestic environment. Please research chatgptProxyAPI for the Chinese environment.