How to make a requirements.txt file per function in Serverless framework?

时间:2018-12-19 11:27:18

标签: python serverless-framework requirements.txt

In my Serverless application i have 2 Lambda Python functions and each one has some package requirements. I followed this article https://serverless.com/blog/flask-python-rest-api-serverless-lambda-dynamodb/#using-the-quick-start-template to create the requirements.txt file.

However in deployment i ended with the 2 functions having the packages listed in requirements.txt while only one should have them.

This is the structure of the app :

- my-app
  - node_modules
  - venv
  - function1
      .handler.py
  - function2
      .handler.py
  .serverless.yml
  .requirements.txt
  .package.json
  .package-lock.json

How to manage to make requirements.txt only be applied to 1 function and not the other one ?

Thanks.

0 个答案:

没有答案