Skip to content

Instantly share code, notes, and snippets.

@msde
Last active June 24, 2016 22:36
Show Gist options
  • Save msde/d5ff92107bea103c29f7bdcfbef21357 to your computer and use it in GitHub Desktop.
Save msde/d5ff92107bea103c29f7bdcfbef21357 to your computer and use it in GitHub Desktop.
.ebextensions file for AWS Elastic Beanstalk ImageMagick --with-webp --quantum-depth 8 --disable-openmp
packages:
yum:
bzip2-devel: []
freetype-devel: []
gcc: []
ghostscript-devel: []
GraphicsMagick: []
libpng-devel: []
libjpeg-turbo-devel: []
libwebp-devel: []
libtiff-devel: []
tcl-devel: []
sources:
/etc/ImageMagick: http://www.imagemagick.org/download/ImageMagick.tar.gz
files:
"/etc/install_imagemagick.sh":
mode: "000755"
owner: root
group: root
content: |
#!/bin/sh -x
if [ "1" == $(convert -list format | grep WEBP | wc -l) ]; then
echo Good ImageMagick already installed.
exit 0
fi
cd /etc/ImageMagick/ImageMagick-*
# webp
# disabling openmp seems to improve things roughly 25%.
# quantum depth 8 improved performance by roughly 20%
./configure --prefix=/usr --with-webp=yes --disable-openmp --with-quantum-depth=8
make
make install
/sbin/ldconfig /usr/local/lib
commands:
01_remove_imagemagick:
command: yum -y remove ImageMagick
02_run_install_imagemagick_script:
command: /etc/install_imagemagick.sh
@msde
Copy link
Author

msde commented Jun 24, 2016

Unfortunately, this increases instance start time from 2-3 minutes to 10-15 minutes.
I recommend creating a custom base AMI if you want reasonable autoscaling.

Based on https://forums.aws.amazon.com/thread.jspa?messageID=673907 among other sources

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