Skip to content

Documentation for switching to using Docker containers needs more clarification #1341

@pcolmer

Description

@pcolmer

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:

  1. When deploying/updating with -d, check the settings file for any settings that could get in the way of a Docker deployment.
  2. When undeploying, remove the archive from the S3 bucket.
  3. Update the documentation to make it clearer which settings should NOT be used if deploying with Docker.

Thank you :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-reviewNeeds attention from a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions