Zappa Docker image based on Lambda compatible base
Docker image for Zappa, based on the Lambda Docker Image
$ git clone [email protected]:danielwhatmuff/zappa.git && cd zappa && docker build -t danielwhatmuff/zappa .
# 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 .
$ docker pull danielwhatmuff/zappa
$ 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
[profile myprofile]
region = ap-southeast-2
role_arn = arn:aws:iam::ACCOUNTNUMBER:role/YourCrossAccountAssumableRole
$ export AWS_PROFILE=myprofile
$ alias zappashell='docker run -ti -e AWS_PROFILE=$AWS_PROFILE -v $(pwd):/var/task -v ~/.aws/:/root/.aws --rm danielwhatmuff/zappa bash'
zappashell> source yourvirtualenv/bin/activate
zappashell> pip install -r requirements.txt
zappashell> zappa deploy
Error: No Lambda ... detected in ... - have you deployed yet?
Warning! Couldn't get function ... in ... - have you deployed yet?