From 775ba2596abaaee8ea9eb3c5c0d16d8a7967cde5 Mon Sep 17 00:00:00 2001 From: qingfengfenga Date: Tue, 16 May 2023 14:34:35 +0800 Subject: [PATCH 1/2] Add docker-compose launch --- .env.template | 4 ++++ .gitignore | 5 ++++- docker-compose.yml | 22 ++++++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .env.template create mode 100644 docker-compose.yml diff --git a/.env.template b/.env.template new file mode 100644 index 000000000..2cc130291 --- /dev/null +++ b/.env.template @@ -0,0 +1,4 @@ +OPENAI_API_KEY=sk-xxxx +CODE=your-password + +PROXY_URL=http://localhost:7890 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 37f6b9029..3c55f8c78 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,7 @@ dev public/prompts.json .vscode -.idea \ No newline at end of file +.idea + +# docker-compose env files +.env \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..c250d0d98 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.9' +services: + chatgpt-next-web: + profiles: ["no-proxy"] + container_name: chatgpt-next-web + image: yidadaa/chatgpt-next-web + ports: + - 3000:3000 + environment: + - OPENAI_API_KEY=$OPENAI_API_KEY + - CODE=$CODE + + chatgpt-next-web-proxy: + profiles: ["proxy"] + container_name: chatgpt-next-web-proxy + image: yidadaa/chatgpt-next-web + ports: + - 3000:3000 + environment: + - OPENAI_API_KEY=$OPENAI_API_KEY + - CODE=$CODE + - PROXY_URL=$PROXY_URL From 50a915b7b6c74463938bd246ca66f234e96d484f Mon Sep 17 00:00:00 2001 From: qingfengfenga Date: Tue, 16 May 2023 15:02:53 +0800 Subject: [PATCH 2/2] docker-compose supports more environment variables --- .env.template | 27 ++++++++++++++++++++++++++- docker-compose.yml | 8 ++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.env.template b/.env.template index 2cc130291..5f3fc02da 100644 --- a/.env.template +++ b/.env.template @@ -1,4 +1,29 @@ + +# Your openai api key. (required) OPENAI_API_KEY=sk-xxxx + +# Access passsword, separated by comma. (optional) CODE=your-password -PROXY_URL=http://localhost:7890 \ No newline at end of file +# You can start service behind a proxy +PROXY_URL=http://localhost:7890 + +# Override openai api request base url. (optional) +# Default: https://api.openai.com +# Examples: http://your-openai-proxy.com +BASE_URL= + +# Specify OpenAI organization ID.(optional) +# Default: Empty +# If you do not want users to input their own API key, set this value to 1. +OPENAI_ORG_ID= + +# (optional) +# Default: Empty +# If you do not want users to input their own API key, set this value to 1. +HIDE_USER_API_KEY= + +# (optional) +# Default: Empty +# If you do not want users to use GPT-4, set this value to 1. +DISABLE_GPT4= diff --git a/docker-compose.yml b/docker-compose.yml index c250d0d98..bfd1725f7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,10 @@ services: environment: - OPENAI_API_KEY=$OPENAI_API_KEY - CODE=$CODE + - BASE_URL=$BASE_URL + - OPENAI_ORG_ID=$OPENAI_ORG_ID + - HIDE_USER_API_KEY=$HIDE_USER_API_KEY + - DISABLE_GPT4=DISABLE_GPT4 chatgpt-next-web-proxy: profiles: ["proxy"] @@ -20,3 +24,7 @@ services: - OPENAI_API_KEY=$OPENAI_API_KEY - CODE=$CODE - PROXY_URL=$PROXY_URL + - BASE_URL=$BASE_URL + - OPENAI_ORG_ID=$OPENAI_ORG_ID + - HIDE_USER_API_KEY=$HIDE_USER_API_KEY + - DISABLE_GPT4=DISABLE_GPT4 \ No newline at end of file