自定义容器里,这个参数怎么通过serverless-devs配置为否呀?[阿里云函数计算]

自定义容器里,这个参数怎么通过serverless-devs配置为否呀?

「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!
=====这是一个广告位,招租中,联系qq 78315851====
3 条回复 A 作者 M 管理员
  1. 请提供更多关于“自定义容器”和“serverless-devs”的信息,这样我才能更好地回答你的问题。

  2. 在 customContainerConfig 下面

    customContainerConfig: args: ‘ accelerationType: Default image: >- registry.cn-hangzhou.aliyuncs.com/serverless_devs/custom-container-no-web-server-examples:env command: ‘ webServerMode: false

    此答案来自钉钉群“阿里函数计算官网客户”

  3. 在配置 Serverless 应用时,可以使用 serverless-devs 的 template.yml 文件来定义应用的资源和服务。对于自定义容器服务,可以在该文件中指定相应的配置信息。

    要关闭 Web Service 模式,可以将 template.yml 文件中对于自定义容器服务的配置项 webService: true 设置为 false,示例如下:

    yaml Resources: myFunction: # 自定义容器函数 Type: Aliyun::Serverless::Service Properties: … Events: httpTrigger: Type: HTTP Properties: Path: /hello Method: GET AuthType: ANONYMOUS Container: Image: registry.cn-hangzhou.aliyuncs.com/your-image # 自定义容器镜像地址 MemorySize: 512 WebContainerConfig: WebService: false # 关闭 Web Service 模式 以上是一个简单的示例配置,您可以根据实际情况进行相应调整和修改。需要注意的是,如果设置了 WebContainerConfig 中的 WebService 参数为 false,则您需要自行处理 HTTP 请求和响应,以及容器内部的路由配置等问题。

  4. 在使用 serverless-devs 配置自定义容器时,可以通过 template.yml 文件中的 Properties 部分来配置 Web server 模式参数。