alibaba / funcraft

(have) Fun with Serverless(API Gateway & Function Compute)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

执行fun local start似乎没有执行Funfile里面的命令?

aliuq opened this issue · comments

commented

版本
fun:3.6.21
docker:windows,Docker version 20.10.5, build 55c4c88

描述
使用fun local start的时候,提示模块不存在,查看docker日志,并没有执行Funfile文件里面的命令

template.yml

ROSTemplateFormatVersion: '2015-09-01'
Transform: 'Aliyun::Serverless-2018-04-03'
Resources:
  fastify-words: # service name
    Type: 'Aliyun::Serverless::Service'
    Properties:
      Description: This is a fastify server
    words: # function name
      Type: 'Aliyun::Serverless::Function'
      Properties:
        Handler: app.handler
        Runtime: nodejs12
        CodeUri: ./dist
        MemorySize: 1024
        InstanceConcurrency: 5
        Timeout: 120
        EnvironmentVariables:
          ENV_TEST: 'Env_Test'

      Events:
        httpTrigger:
          Type: HTTP
          Properties:
            AuthType: ANONYMOUS
            Methods: ['GET', 'POST', 'PUT']
  Domain:
    Type: Aliyun::Serverless::CustomDomain
    Properties:
      DomainName: Auto
      Protocol: HTTP
      RouteConfig:
        Routes:
          "/*":
            ServiceName: fastify-words
            FunctionName: words

Funfile

RUNTIME nodejs12
RUN npm install

文件结构

image

Docker日志

image

Docker里文件结构

image

期待

能够正常执行

麻烦先 fun install 来安装依赖,这个指令会执行 Funfile 中的内容来安装依赖,可以参考 https://developer.aliyun.com/article/719100

commented

@git-qfzhang 好的,谢谢