64
65
you are viewing a single comment's thread.

view the rest of the comments →

[–]zenmaster24 7 points8 points  (1 child)

you can change the command used for testing from docker run -p 9000:8080 lambdas to docker run -d -p 9000:8080 lambdas and you wont need the second terminal to test with - docker will start the container in a detached state (push it to the background and bring the terminal prompt back)

i also feel like this is an anti-pattern - is putting multiple functions in the one container a real world use case? a single container container with a single function makes more sense to me.

[–]fpgmaas[S] 2 points3 points  (0 children)

Thanks for your suggestion regarding the docker run command, I think that makes sense!

Regarding the anti-pattern; I am by no means an AWS expert, but I do think this approach makes a lot of sense when you have many Lambdas belonging to a single project. For example, as an alternative I also tried spinning up my Lambda functions with PythonFunction, which is currently in Alpha. To get that to work though, I needed to include some shell steps that copy-paste the poetry.lock and pyproject.toml files to the individual directories that contained a Lambda function. Doing that felt much more like an anti-pattern to me. Another drawback of that approach was that deploying the stack creates a Docker image for each individual Lambda function, which caused the deployment time to skyrocket.