Closed Whichbfj28 closed 2 months ago
Please follow the issue template to update title and description of your issue.
Bot detected the issue body's language is not English, translate it automatically.
Title: How to modify the default 3000 port in docker
docker. Due to demand reasons, only host mode can be used. Port 3000 conflicts with another program. How to modify.
docker. Due to demand reasons, only host mode can be used. Port 3000 conflicts with another program. How to modify.
No response
No response
添加环境变量:
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
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
Problem Description
docker。因为需求原因只能使用host模式。3000端口跟另一个程序冲突了。怎么修改。
Solution Description
docker。因为需求原因只能使用host模式。3000端口跟另一个程序冲突了。怎么修改。
Alternatives Considered
No response
Additional Context
No response