- 
                Notifications
    
You must be signed in to change notification settings  - Fork 376
 
Description
I've recently switched from using Zappa to handle the entire deployment, to using a Docker container.
The documentation links to https://ianwhitestone.work/zappa-serverless-docker/ for further details of how this works and how to use it. That article says "Our zappa_settings.json is pretty minimal, and no different from the zappa_settings you’re used to. The only thing worth mentioning is you don’t need to specify a Python runtime since that will be set in the Docker image."
What I have discovered, however, is that if the Zappa settings file specifies slim_handler then the exported Python settings file includes a value for ARCHIVE_PATH which, in turn, means that when the Lambda fires up, the handler checks for ARCHIVE_PATH and, if it is defined, tries to load the archive from S3.
That archive is left behind if you undeploy/deploy ... and it also means that the handler loads what could be old code.
I only discovered this by undeploying, completely wiping everything out, re-deploying and then getting handler errors in CloudWatch because it couldn't load the archive. I then had to dig into the source code to figure out why there was an ARCHIVE_PATH being set.
There are a couple of improvements I would suggest:
- When deploying/updating with 
-d, check the settings file for any settings that could get in the way of a Docker deployment. - When undeploying, remove the archive from the S3 bucket.
 - Update the documentation to make it clearer which settings should NOT be used if deploying with Docker.
 
Thank you :)