Last active
October 19, 2021 05:49
-
-
Save htr3n/12ac5dff3b4d04d52ee1cc71243f94fd to your computer and use it in GitHub Desktop.
node-canvas-lambda-container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM public.ecr.aws/lambda/nodejs:14 | |
## | |
# Install necessary package for building Node.js Canvas | |
## | |
RUN yum -y update \ | |
&& yum -y groupinstall "Development Tools" \ | |
&& yum install -y nodejs gcc-c++ cairo-devel libjpeg-turbo-devel pango-devel giflib-devel zlib-devel librsvg2-devel | |
COPY *.js package* ./ | |
RUN npm install --only=prod | |
ENV LD_PRELOAD=/var/task/node_modules/canvas/build/Release/libz.so.1 | |
RUN yum remove -y cairo-devel libjpeg-turbo-devel pango-devel giflib-devel zlib-devel librsvg2-devel | |
# Set the CMD to your handler (could also be done as a parameter override outside of the Dockerfile) | |
CMD [ "index.handler" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment