-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building a static libpq for AWS Lambda #29
Comments
@whatupdave @dcrockwell I've uploaded a libpq created with static binding to libpq for use on aws lambda. All lib files should go inside lib folder and libpq folder should go inside node_modules wherever its required. To create this I used the postgres 9.4 source and created libpq and pg_config.
Make sure that PATH contains path to pg_config and LD_LIBRARY_PATH points to your new libpq so's. Then you should be able to build node-libpq for aws via: npm install node-libpq. Hope that helps. |
@boriscosic Can you provide some more details on how you compiled libpq statically for includes in node_modules? |
I've been able to mostly replicate this with the following Dockerfile. However if I build
Then to extract the result from the container: docker build .
docker run $(docker build . -q) zip -r - lib/ node_modules/ > lib.zip I've just been adding the rest of my files to this zip and uploading, but I should probably make it a layer. |
Updating to use openssl11 enables me to build / run successfully with ssl support:
Then to extract the result from the container: docker build .
docker run $(docker build . -q) zip -r9 - lib/ node_modules/ > lib.zip |
Trying to get this working on AWS Lambda, getting this:
According to this article: https://aws.amazon.com/blogs/compute/nodejs-packages-in-lambda/ libpq needs to be statically compiled. I'm a little out of my depth here, but is this something that can be done easily?
The text was updated successfully, but these errors were encountered: