serverless-sharp
serverless-sharp copied to clipboard
FR: dockerize deployment
So we don't have to recompile for amazon linux, etc.
You can run npm install with --arch=x64 --platform=linux to ensure you get the linux binaries for the lambda AMI
I previously put in a PR on the old repo that would pull it in, not sure where/if you'd want it for this though.
Thanks @ganey.
I think the issue if having to juggle between platforms…so if you're on a Mac and you you npm install with --arch=x64 --platform=linux to deploy, then you wont be able to serverless offline until you wipe it and install again.
If we do it in a docker container we can keep the platforms separate.
Hmm, that's true, I already have that problem after deploying & then trying tests on a different fork I'm working with.
The only downside I can see with the docker container is if you use multiple sets of aws credentials, you'd have to somehow pass those into the docker container so that either the serverless file can find them, or the deploy command can find them with the --aws-profile flag
aws-profile option details: https://serverless.com/framework/docs/providers/aws/guide/credentials#using-the-aws-profile-option
@ganey hadn't considered that bit yet – good point