Skip to content

Instantly share code, notes, and snippets.

@zeroasterisk
Created September 21, 2016 19:04
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeroasterisk/ad72b6737623d85be28f5ce23e755b90 to your computer and use it in GitHub Desktop.
Save zeroasterisk/ad72b6737623d85be28f5ce23e755b90 to your computer and use it in GitHub Desktop.
Build a node lambda function for
#!/bin/bash
# If you are developing on OSX on Windows
# but you want to run on linux - or in docker - or on AWS Lambda
# PhantomJS must be the binary for that OS...
# https://github.com/sindresorhus/pageres/issues/275
#
# Easiest solution, download inside a docker, running on linux
#
# This script should be run from within the docker container
#
# Usage
# ---------
# docker run -it -v `pwd`:/app node:latest /app/buildPhantomJSAsLinux-InDocker.sh
#
# when it exits, docker exits.
set -e
echo "building in docker"
cd /app
rm -rf node_modules/phantomjs-prebuilt/
npm install
#!/bin/bash
# If you are developing on OSX on Windows
# but you want to run on linux - or in docker - or on AWS Lambda
# PhantomJS must be the binary for that OS...
# https://github.com/sindresorhus/pageres/issues/275
#
# Easiest solution, download inside a docker, running on linux
#
# 1. install docker
# 2. Run this script, located as a sibling of your package.json file
set -e
docker run -it \
-v `pwd`:/app \
node:latest \
/app/buildPhantomJSAsLinux-InDocker.sh
@ykessler
Copy link

Thank you for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment