serverless-localstack
serverless-localstack copied to clipboard
How to work with mountCode and webpack?
I'm working with mountCode + serverless-webpack. My main question is:
-
Do I need to create a docker volume? If so, how should this volume be defined?
-
Does it make sense to use
mountCodetogether withLAMBDA_REMOTE_DOCKER=true?
@fterradev did you manage to solve your issue pls?
Could be that I'm having the same issue - https://github.com/localstack/serverless-localstack/issues/171
Same for me, the documentation unfortunately is very ambiguous.
I've been trying to make this work with the following setup:
Docker-compose with two services:
- app: This is a serverless framework app that depends on
serverless-webpackandserverless-localstack - localstack: This is based on image
localstack/localstack:latest
To run:
docker-compose up localstackdocker-compose up appto build and deploy the lambdas (which invokesserverless webpack --stage localandserverless deploy --stage local)
A .webpack folder is created in the host and without mountCode everything is deployed fine, although it takes around 5+ minutes because of all the docker bindings.
I wanted then to improve by binding the .webpack folder to localstack /tmp/localstack (according to documentation), but unfortunately it won't work, I've tried all kinds of env var + serverless configuration settings.