Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker启动系统后,想要修改前端的端口应该在哪里修改呢? #194

Open
Ansrg123 opened this issue Sep 5, 2024 · 1 comment

Comments

@Ansrg123
Copy link

Ansrg123 commented Sep 5, 2024

docker启动系统后,想要修改前端的端口应该在哪里修改呢?

@lcolok
Copy link
Contributor

lcolok commented Sep 9, 2024

要修改前端的端口映射,您需要按以下步骤操作:

  1. 找到配置文件:定位到 MindSearch/docker/msdl/templates/docker-compose.yaml 文件。

  2. 在文件中定位 frontend 服务的配置部分。

  3. 找到 ports 配置项。它的格式通常是 "主机端口:容器端口"。例如:

    ports:
      - "8080:8080"
  4. 修改主机端口(左侧数值):这是您想要在主机上使用的新端口号。容器端口(右侧数值)保持不变,因为这是应用在容器内部使用的端口。

  5. 例如,如果您想将前端服务映射到主机的 18080 端口,可以这样修改:

    ports:
      - "18080:8080"
  6. 保存文件并重新启动 Docker 容器以应用更改。

请注意,修改端口后,您需要使用新的端口号来访问前端服务。例如,如果之前通过 http://localhost:8080 访问,现在需要使用 http://localhost:18080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants