New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker options for running Docker Lambda within a Docker container #1164
Conversation
…hed from an artifact Co-authored-by: frozenbonito <t.aoki1130@gmail.com>
Thank you for your great work @apancutt. |
@apancutt |
That's already enabled. Not working? |
For some reason, I couldn't push to your repository directly. |
Thank you! |
Description
Extends PR #961 with additional changes:
dockerNetwork
optionDOCKER_LAMBDA_WATCH
to restart Docker Lambda on filesystem changesREADME.md
README.md
README.md
defaultOptions.js
DockerContainer.js
as required by prettierMotivation and Context
Cold starts with vanilla serverless-offline are extremely slow (we were getting average response times of ~700ms with a Koa API). The
useDocker
option addresses this by keeping a container warm but this has several issues...--dockerHost
and--dockerHostServicePath
options)DOCKER_LAMBDA_WATCH=1
to Docker container env)--dockerNetwork
option).How Has This Been Tested?
Tested within a development environment provisioned using Docker Compose running several service containers, one of which is serverless-offline. The API running in this container is now fully operational with the
--useDocker
option enabled and hot-reloads on file changes. Response times reduced from ~700ms to ~60ms.