Skip to content

kilna/python-lambda-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

alpine-aws-python-lambda

Lightweight docker image for running and packaging python-lambda code.

This is based on the super useful python-lambda library:

https://github.com/nficano/python-lambda/

Usage

An example of a usable project can be found in the directory. This example lambda function takes a JSON input file like event.json and returns an ASCII-art version of the text.

The Dockerfile in the example directory loads the current workspace into the image and installs dependencies from the requirements.txt file:

COPY . /workspace
RUN pip install -r requirements.txt

To build a docker image called 'example-lambda-image' with the lambda function in it, run:

If you want to execute the lambda function against an event.json input file:

  _  _         _   _                                    _      _   _
 | || |  ___  | | | |  ___        __ __ __  ___   _ _  | |  __| | | |
 | __ | / -_) | | | | / _ \  _    \ V  V / / _ \ | '_| | | / _` | |_|
 |_||_| \___| |_| |_| \___/ ( )    \_/\_/  \___/ |_|   |_| \__,_| (_)
                            |/

If you would like to see if your lambda function builds properly, run:

If you would like to get a ZIP file of the lambda function suitable for uploading to Amazon:

dist/2017-08-31-212523-example-lambda.zip

About

Lightweight docker image for running, testing, packaging and deploying python-based AWS lambda functions

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors