NextChat icon indicating copy to clipboard operation
NextChat copied to clipboard

BASE_URL and CODE environment variables have no effect with Docker Compose

Open joshfester opened this issue 2 years ago • 2 comments

Describe the bug I have this setup at abc.com, and a LocalAI instance setup at xyz.com. I have the following docker compose file:

version: '3.6'

services:
  api:
    image: yidadaa/chatgpt-next-web
    environment:
      OPENAI_API_KEY: asdf1234
      CODE: asdf1234
      BASE_URL: https://xyz.com
      CUSTOM_MODELS: -all,+mixtral
    ports:
      - 3000:3000

The CUSTOM_MODELS variable seems to work. In the app settings, "mixtral" is the only option in the dropdown, and it is selected by default.

The CODE variable does not seem to do anything. When I click the "auth" link to enter a password, I can type anything and it works. I can even ignore the "auth" message and just start entering prompts.

When I try entering a prompt, the request always goes to https://abc.com/v1/chat/completions, regardless of what I set in the BASE_URL variable. It should be going to https://xyz.com/v1/chat/completions

To Reproduce

  1. Set custom environment variables in docker-compose.yml
  2. docker compose up -d
  3. Try using the app

Expected behavior The CODE environment variable should require the correct password. Requests should go to the domain set in the BASE_URL variable.

Screenshots If applicable, add screenshots to help explain your problem.

Deployment

  • [x] Docker
  • [ ] Vercel
  • [ ] Server

Desktop (please complete the following information):

  • OS: MacOS, Windows
  • Browsers: Chrome, Firefox, Safari

joshfester avatar Dec 29 '23 17:12 joshfester

Have the same problem

kylinpoet avatar Jan 18 '24 00:01 kylinpoet

Have the same problem the BASE_URL env var does not work at all

MC-XiaoHei avatar Mar 24 '24 07:03 MC-XiaoHei