softprops / serverless-rust

⚡ 🦀 a serverless framework plugin for rustlang applications
https://www.npmjs.com/package/serverless-rust
MIT License
541 stars 81 forks source link

Allow root path of build to be different than the directory the serverless yaml is in. #68

Closed aklitzke closed 4 years ago

aklitzke commented 4 years ago

Docker can't access resources outside of the current build directory. This poses a problem if the serverless yaml is inside a workspace, and we want pull in other packages from the workspace. Such as:

member1/Cargo.toml
member1/serverless.yaml
common/Cargo.toml
Cargo.toml

Currently, member1 cannot use common as a dependency because of limitations to the folders accessible by docker.

This PR introduces the ability to programmatically configure docker so that we can build it from the workspace root, and allows member1 to depend on common.

Can be configured in serverless.yaml via:

custom:
  rust:
    dockerPath: "../"

credit to @danielharbor who made this with me

softprops commented 4 years ago

Thanks for adding a solution for this @aklitzke