1 Star 0 Fork 0

Serverless Devs Registry / springboot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

阿里云 SpringBoot 框架组件

快速体验

  • 初始化项目:s init devsapp/start-springboot
  • 进入项目后部署:s deploy
  • 部署过程中可能需要阿里云密钥的支持,部署完成之后会获得到临时域名可供测试

示例Yaml

edition: 1.0.0          #  命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范
name: functionApp       #  项目名称
access: default  #  秘钥别名

services:
  springbootExample: #  服务名称
    component: devsapp/springboot  # 组件名称
    props: #  组件的属性值
      region: cn-shanghai
      service:
        name: serverless-devs
        description: Serverless Devs示例程序
      function:
        name: springboot
        description: SpringBoot 项目
        memorySize: 256
        code:
          src: ./src
        customContainerConfig:
          command: '["java", "-jar", "test.java"]'

完整Yaml

edition: 1.0.0          #  命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范
name: flaskApp          #  项目名称
access: aliyun-release  #  秘钥别名

services:
  framework-test: #  服务名称
    component: flask  # 组件名称
    props:
      region: cn-shenzhen # 阿里云函数计算所支持的地区
      service:
        name: web-flask # 服务名
        # logConfig: Auto # 日志配置,可以是Auto
        logConfig:
            logStore: test # loghub中的logstore名称
            project: test # loghub中的project名称
        description: 测试环节 # 所在服务描述
        # role: auto # 角色
        role: 
            name: test # 角色名
            statement:  # 角色授权 statement,配置后不生效 service 不生效, statement 和 service 必填其一
                - Effect: Deny # Effect设置,同意或拒绝
                  Action: sts:AssumeRole # 行为,动作
                  Principal: Principal
      function:
        name: test # 函数名
        description: test # 函数描述
        customContainerConfig: # 自定义镜像配置
          image: registry.cn-shenzhen.aliyuncs.com/test-wss/nodejs12:v0.1 # 镜像仓库地址
          command: '["node", "index.js"]' # 启动指令
          args: '["--port", "9000"]' # 启动参数
        caPort: 9000 # 监听端口
        code: # 代码包配置
          src: ./src # 本地路径
          excludes: # ignore文件
            - package-lock.json
        environmentVariables: # 环境变量配置
          test: demo
      trigger: # 触发器配置
        name: def # 触发器名称
        type: http # 触发器类型,只支持http
        config: # 触发器详情
          authType: anonymous # 权限配置
          methods: # 请求方法
            - GET
            - POST
            - PUT
      customDomains: # 自定义域名配置
        - domainName: Auto # 自动获取域名,*.devsapp.cn
          protocol: HTTP # 协议
          routeConfigs: # 路径配置
            - path: '/*'
        - domainName: test.shoushuai.top
          protocol: HTTP,HTTPS
          routeConfigs:
            - path: '/'
          certConfig: # http证书配置
            certName: test
            certificate: ./certConfigCutom/cate.pem
            privateKey: ./certConfigCutom/key.pem

额外说明

该框架部署会支持两种模式:

  • NAS+Container的模式:这种模式是默认的模式,也可以通过s cli fc-default set web-framework nas指定
    这种模式的好处是,可以尽可能的0改造,包括一些存在当前目录的缓存,上传等,实际的逻辑是函数计算仅作为一个运行环境,代码全部放在NAS中。坏处是,没办法更好的使用函数计算的灰度功能,因为代码存放在nas中,所以灰度会受影响,但是预留不会受到影响;
  • Container的模式:可以通过s cli fc-default set web-framework container指定
    这种模式相对上一个的好处是,代码和环境都会放在函数计算的容器中,相对来说可以更好的支持灰度发布,但是可能涉及到函数的一些改造,例如持久化某些资源等;
MIT License Copyright (c) 2020 Serverless Devs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

None 展开 收起
MIT
取消

发行版 (5)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/devsapp/springboot.git
git@gitee.com:devsapp/springboot.git
devsapp
springboot
springboot
main

搜索帮助