missuo / FreeGPT35

Utilize the unlimited free GPT-3.5-Turbo API service provided by the login-free ChatGPT Web.
GNU Affero General Public License v3.0
3.34k stars 1.03k forks source link

FreeGPT35(docker) + ChatGPT-Next-Web(docker) 搭建出现问题... #13

Closed ijrou closed 5 months ago

ijrou commented 5 months ago

docker run -d --name free_gpt --restart=always -p 3040:3040 ghcr.io/missuo/freegpt35

docker run -d --name gpt_next_web -p 3000:3000 yidadaa/chatgpt-next-web

宿主机上执行如下正确返回:

curl http://172.17.0.2:3040/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer any_string_you_like" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [
      {
        "role": "user",
        "content": "你好啊!"
      }
    ],
    "stream": true
    }'

image

但是部署到 chatgpt-next-web (使用域名反向代理到了chatgpt-next-web 容器)中就无法使用: image

image

missuo commented 5 months ago

I noticed that the server logs have returned the Stream Response normally, indicating that the server is operating normally. Please check your next-web configuration.

chunzha1 commented 5 months ago

直接使用域名好像网页版不行,另外next-web好像不需要加/v1和后面的那部分?

ijrou commented 5 months ago

直接使用域名好像网页版不行,另外next-web好像不需要加/v1和后面的那部分?

你成功了吗?

alexallen1 commented 5 months ago

I noticed that the server logs have returned the Stream Response normally, indicating that the server is operating normally. Please check your next-web configuration.

Can you as a teacher, show next-web examples

gandli commented 5 months ago

增加 tls 试试 docker-compose.yml:

services:
  freegpt35:
    container_name: freegpt35
    image: missuo/freegpt35:latest

  caddy:
    container_name: caddy
    image: caddy:2
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config
    ports:
      - "80:80"
      - "443:443"
    depends_on:
      - freegpt35

volumes:
  caddy_data:
  caddy_config:  

Caddyfile:


{ you_domain } {
    handle_path /gpt/* {
        reverse_proxy freegpt35:3040
    }
}
missuo commented 5 months ago

增加 tls 试试 docker-compose.yml:

services:
  freegpt35:
    container_name: freegpt35
    image: missuo/freegpt35:latest

  caddy:
    container_name: caddy
    image: caddy:2
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config
    ports:
      - "80:80"
      - "443:443"
    depends_on:
      - freegpt35

volumes:
  caddy_data:
  caddy_config:  

Caddyfile:

{you_domain } {
    handle_path /gpt/* {
        reverse_proxy freegpt35:3040
    }
}

This will occupy 80 443, and you won't be able to deploy any other web services.