Skip to content

Instantly share code, notes, and snippets.

@dduvnjak
Last active October 28, 2017 15:25
Show Gist options
  • Save dduvnjak/3b21e247c9fcd409a12d to your computer and use it in GitHub Desktop.
Save dduvnjak/3b21e247c9fcd409a12d to your computer and use it in GitHub Desktop.
Elastic Beanstalk configuration file for installing phantomjs globally
files:
"/opt/elasticbeanstalk/nodepath.rb":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env ruby
require 'json'
cc = "/opt/elasticbeanstalk/deploy/configuration/containerconfiguration"
j = JSON.parse(File.read(cc))
node_version = j["optionsettings"]["aws:elasticbeanstalk:container:nodejs"]["NodeVersion"]
node_path = "/opt/elasticbeanstalk/node-install/node-v#{node_version}-linux-x64/bin/"
puts node_path
commands:
install_phantom:
command: bash -c "PATH=`/opt/elasticbeanstalk/nodepath.rb`:\$PATH npm -g install phantomjs"
@ralphioooo
Copy link

Would this work for a PHP version of Elastic Beanstalk?

@dduvnjak
Copy link
Author

It wouldn't, preinstalled Node.js is required for it to work.

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