serverless-sharp icon indicating copy to clipboard operation
serverless-sharp copied to clipboard

FR: dockerize deployment

Open timkelty opened this issue 6 years ago • 4 comments

So we don't have to recompile for amazon linux, etc.

timkelty avatar Jul 30 '19 13:07 timkelty

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.

ganey avatar Jul 30 '19 14:07 ganey

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.

timkelty avatar Jul 30 '19 14:07 timkelty

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 avatar Jul 30 '19 14:07 ganey

@ganey hadn't considered that bit yet – good point

timkelty avatar Jul 30 '19 14:07 timkelty