Skip to content
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

How to work with mountCode and webpack? #159

Open
fterradev opened this issue Aug 6, 2021 · 2 comments
Open

How to work with mountCode and webpack? #159

fterradev opened this issue Aug 6, 2021 · 2 comments

Comments

@fterradev
Copy link

fterradev commented Aug 6, 2021

I'm working with mountCode + serverless-webpack.
My main question is:

  1. Do I need to create a docker volume? If so, how should this volume be defined?

  2. Does it make sense to use mountCode together with LAMBDA_REMOTE_DOCKER=true?

@ivanmartos
Copy link

ivanmartos commented Nov 16, 2021

@fterradev did you manage to solve your issue pls?

Could be that I'm having the same issue - #171

@bertrandmc
Copy link

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:

  1. app: This is a serverless framework app that depends on serverless-webpack and serverless-localstack
  2. localstack: This is based on image localstack/localstack:latest

To run:

  1. docker-compose up localstack
  2. docker-compose up app to build and deploy the lambdas (which invokes serverless webpack --stage local and serverless 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants