[小技巧] chatgpt-web docker composer
date
Mar 4, 2023
slug
tip-chatgpt-web-another-by-docker
status
Published
summary
小技巧
tags
tip
chatgpt
type
Post
URL
Problem & Summary
Solution
export DOCKER_PROJ=chatgpt-web
mkdir /data/$DOCKER_PROJ; cd /data/$DOCKER_PROJ
cat > docker-compose.yml <<EOF
version: '3'
services:
app:
image: chenzhaoyu94/chatgpt-web # 总是使用 latest ,更新时重新 pull 该 tag 镜像即可
container_name: chatgpt-web
# ports:
# - 3002:3002
environment:
# 二选一
OPENAI_API_KEY: sk-BhylhMBUYzVuUM63
# 二选一
#OPENAI_ACCESS_TOKEN: xxxxxx
# API接口地址,可选,设置 OPENAI_API_KEY 时可用
OPENAI_API_BASE_URL: https://openaiapi.xxx.xxx
# API model, optional, available when OPENAI_API_KEY is set, https://platform.openai.com/docs/models
# gpt-4, gpt-4-turbo-preview, gpt-4-0125-preview, gpt-4-1106-preview, gpt-4-0314, gpt-4-0613, gpt-4-32k, gpt-4-32k-0314, gpt-4-32k-0613, gpt-3.5-turbo-16k, gpt-3.5-turbo-16k-0613, gpt-3.5-turbo, gpt-3.5-turbo-0301, gpt-3.5-turbo-0613, text-davinci-003, text-davinci-002, code-davinci-002
OPENAI_API_MODEL: gpt-4-turbo-preview
# 反向代理,可选
#API_REVERSE_PROXY: xxx
# 超时,单位毫秒,可选
#TIMEOUT_MS: 60000
# Socks代理,可选,和 SOCKS_PROXY_PORT 一起时生效
#SOCKS_PROXY_HOST: xxxx
# Socks代理端口,可选,和 SOCKS_PROXY_HOST 一起时生效
#SOCKS_PROXY_PORT: xxxx
networks:
default:
name: npm_nginx_proxy_manager-network
external: true
EOF
docker-compose down; docker-compose up -d; sleep 1s; docker-compose logs -f