Docker Quick Setup for ChatGPT Web Version#
This guide provides detailed steps on how to quickly set up a visually appealing and stable ChatGPT web version using Docker. The setup process does not depend on a specific network environment.
Get OpenAI API Key#
- Visit OpenAI API keys and obtain an API key.
Environment Deployment#
-
Update the system environment and install necessary tools:
apt update -y && apt upgrade -y && apt install -y curl wget sudo socat
-
Install Docker:
curl -fsSL https://get.docker.com | sh
-
Install Docker Compose:
curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
GPT Setup Method 1#
-
Create GPT directory and configuration file:
cd /home/ && mkdir gpt && cd gpt && nano docker-compose.yml
-
Edit the compose configuration file (
docker-compose.yml
) to configure the service details. -
Run Docker Compose to start the service:
cd /home/gpt && docker-compose up -d
GPT Setup Method 2#
- Use a one-click Docker command to run the service, making sure to modify it with your own API key and other configurations:
docker run -d --name gpt-app-1 -p 3002:3002 -e OPENAI_API_KEY=<Your API Key> -e OPENAI_API_BASE_URL=https://api.openai.com -e AUTH_SECRET_KEY=<Your Password> -e OPENAI_API_MODEL=gpt-3.5-turbo chenzhaoyu94/chatgpt-web
NGINX Reverse Proxy to Domain#
- Create the nginx directory structure, apply for a certificate, and configure nginx.
- Configure the reverse proxy to proxy to the specified IP and port.
- Deploy the NGINX container and check its running status.
Auto Start on Boot#
- Set containers to start automatically:
docker update --restart=always nginx docker update --restart=always gpt-app-1
Common Docker Commands#
Original author's GitHub address: Chanzhaoyu/chatgpt-web