danielwhatmuff / zappa

Zappa Docker image based on Lambda compatible base
83 stars 25 forks source link
docker lambda serverless zappa zappa-docker-image

Zappa

Docker image for Zappa, based on the Lambda Docker Image

Build the image

$ git clone git@github.com:danielwhatmuff/zappa.git && cd zappa && docker build -t danielwhatmuff/zappa .

Build a customized image with extra build deps

# Add extra installs to the Dockerfile.update file, then run:
$ docker build --build-arg version=< zappa version > -t danielwhatmuff/zappa:< zappa version > -f Dockerfile.update .
# e.g.
$ docker build --build-arg version=0.38.1 -t danielwhatmuff/zappa:0.38.1 -f Dockerfile.update .

Or pull the image from Docker Hub

$ docker pull danielwhatmuff/zappa

Using exported AWS_DEFAULT_REGION, AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID env vars

$ alias zappashell='docker run -ti -e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY -e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID -e AWS_DEFAULT_REGION=$AWS_DEFAULT_REGION -v $(pwd):/var/task  --rm danielwhatmuff/zappa bash'
$ alias >> ~/.bash_profile
$ cd yourzappaproject
$ zappashell
# Create a persistent virtualenv within the mounted volume and activate it
zappashell> virtualenv venv 
zappashell> source venv/bin/activate
# OR use the prebaked one...
zappashell> source /var/venv/bin/activate
# Install your requirements
zappashell> pip install -r requirements.txt
# Deploy the thing
zappashell> zappa deploy
# Update the thing
zappashell> zappa update

Using cross account IAM role from CLI config ~/.aws/credentials or ~/.aws/config

Known Issues