Created
October 31, 2018 10:31
-
-
Save tayfun/4e6535e6627987769a45202c7c0b191a to your computer and use it in GitHub Desktop.
Makefile for building lambda for Sharp with bmp support
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
SHELL := /bin/bash | |
all: docker-image compile package | |
docker-image: | |
docker build --tag lambci/lambda:vips . | |
compile-origin-response: | |
# `compile-*` is only run so that we have node_modules dir with | |
# dependencies that can be packaged into a zip file with `package` target | |
# below. | |
docker run --rm --volume ${PWD}/lambda/origin-response-function:/build/lambda lambci/lambda:vips /bin/bash -c "npm init -f -y; PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ npm install sharp querystring raven --save; npm install --only=prod; cp /usr/local/lib/libvips.so.42 ./lib; cp /usr/local/lib/libvips-cpp.so.42 ./lib; cp /usr/lib64/libfftw3.so.3 /build/lambda/lib/; cp /usr/lib64/libwebp.so.4 /build/lambda/lib/; cp /usr/lib64/libexif.so.12 /build/lambda/lib/" | |
package-origin-response: | |
mkdir -p dist && cd lambda/origin-response-function && zip -FS -q -r ../../dist/origin-response-function.zip * && cd ../.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment