Hey,
I’m working on a monorepo project with a shared library folder alongside a backend folder. I would like to define a garden module for the backend service inside the backend folder, but it’s using some of the features from shared library, so I would need to include “**…/libs/shared/” in the build context for the Dockerfile to be able to access it. Unfortunately, this doesn’t seem to be an option. The only alternative that I can think of is defining the module in the top-level garden file but it’s going to get messy really quickly when we start adding microservices. Is there a way to do this in a way that’s more elegant?
Hi Dawid!
One way to accomplish this would be to wrap the shared library in an exec
module, and add a build dependency on the shared module for the backend
module.
The build-dependencies
example project in our repo demonstrates a similar pattern: garden/examples/build-dependencies at master · garden-io/garden · GitHub
Hope this helps!