ChatGPTNextWeb / ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT/Gemini 应用。
https://app.nextchat.dev/
MIT License
74.89k stars 58.96k forks source link

docker怎么修改默认的3000端口 #4967

Closed Whichbfj28 closed 2 months ago

Whichbfj28 commented 2 months ago

Problem Description

docker。因为需求原因只能使用host模式。3000端口跟另一个程序冲突了。怎么修改。

Solution Description

docker。因为需求原因只能使用host模式。3000端口跟另一个程序冲突了。怎么修改。

Alternatives Considered

No response

Additional Context

No response

nextchat-manager[bot] commented 2 months ago

Please follow the issue template to update title and description of your issue.

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: How to modify the default 3000 port in docker

Problem Description

docker. Due to demand reasons, only host mode can be used. Port 3000 conflicts with another program. How to modify.

Solution Description

docker. Due to demand reasons, only host mode can be used. Port 3000 conflicts with another program. How to modify.

Alternatives Considered

No response

Additional Context

No response

Whichbfj28 commented 2 months ago

添加环境变量:

    environment: 
      - PORT=3002

可以修改为3002端口 另外。host模式的时候。反代比较奇葩。不是常见的http://127.0.0.1、或者http://localhost 而是http://debian:3002 或者http://公网ip:3002

   ▲ Next.js 14.1.1
   - Local:        http://debian:3002
   - Network:      http://vpsip:3002
Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Add environment variables:

environment:
-PORT=3002

Can be modified to port 3002 in addition. When in host mode. Being anti-generational is rather weird. Not the common http://127.0.0.1 or http://localhost But http://debian:3002 or http://public network ip:3002

▲ Next.js 14.1.1
- Local: http://debian:3002
- Network: http://vpsip:3002