Skip to content

Recursively adding directory and its contents to requirements package #542

Open
@nathanielrindlaub

Description

@nathanielrindlaub

Hello - first off, this is an awesome plugin and I think it will greatly improve my current clunky build workflow. I just have one question: I see that you can add single files to the final deployment package with the dockerExtraFiles option, but I was curious whether there's an easy way to pull in a directory and all of its contents into the final deployment/requirements package.

Specifically in my case I have a Python Lambda function that utilizes a perl executable called exiftool to parse metadata from images. In my current (very manual) workflow I start up a lambci/lambda docker container in interactive mode, manually download and unzip Exiftool, copy the pieces of it I need into a separate directory, pip install the rest of my dependencies, then zip up the exiftool directory and all of the python packages and finally add my lambda function to the deployment package. My zipped up package ends up looking like this:

├── function.zip
      ├── handler.py
      └── exiftool
           ├── exiftool // exiftool executable 
           └── lib
               └── ...
      └── PIL
           ├── ...
      ... 

How would I go a about replicating that with the serverless-python-requirements plugin? Perhaps I have to write that entire process to a dockerfile and use the dockerFile option in my serverless.yml? If you use a custom dockerfile, are you responsible for instructing Docker to install all other python dependencies from within the Dockerfile or will this plugin still automatically look for a requirements.txt and intall + add them to the deployment package at build?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions