如何使用Azure Web App容器公开端口3000? [英] How do you expose port 3000 using an Azure Web App Container?

查看:111
本文介绍了如何使用Azure Web App容器公开端口3000?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在托管的Docker容器中运行反应样板应用 Azure Web App容器.

I'm running a react boilerplate app within a docker container, hosted Azure Web App Containers.

在本地,我通过以下方式旋转应用程序:

Locally, I spin the app up with:

docker run -p 3000:3000 431e522f8a87

我的docker文件如下所示:

My docker file looks like this:

FROM node:8.9.3
EXPOSE 3000
RUN mkdir -p src
WORKDIR /src
ADD . /src
RUN yarn install
RUN yarn build 
CMD ["yarn", "run", "start:prod"]

应用设置

我尝试使用键/值对编辑应用程序设置,但无济于事:WEBSITES_PORT=3000

I've tried editing the Application Settings, to no avail, with the key/value pair: WEBSITES_PORT=3000

显然

80 :默认端口,用于在App Service环境中运行在App Service计划中的App的入站HTTP流量.在启用了ILB的ASE上,此端口绑定到ASE的ILB地址.

80: Default port for inbound HTTP traffic to apps running in App Service Plans in an App Service Environment. On an ILB-enabled ASE, this port is bound to the ILB address of the ASE.

443:用于向在App Service环境中的App Service Plan中运行的应用程序的入站SSL流量的默认端口.在启用了ILB的ASE上,此端口绑定到ASE的ILB地址.

443: Default port for inbound SSL traffic to apps running in App Service Plans in an App Service Environment. On an ILB-enabled ASE, this port is bound to the ILB address of the ASE.

如何在Azure App Service中公开端口 3000 ?

How do I expose port 3000 in an Azure App Service?

推荐答案

用户 4c74356b41 是正确的.

应用程序设置中,您需要设置键/值对 WEBSITES_PORT .

In APPLICATION SETTINGS you need to set the key / value pair WEBSITES_PORT.

由于某种原因,它无法在此图像上工作,但是我通过另一个示例并通过命令行完成了所有工作,并且效果很好.

For some reason it's not working on this image, but I went through another example and did it all through the command line, and it worked fine.

这篇关于如何使用Azure Web App容器公开端口3000?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆