Last active
June 24, 2016 22:36
-
-
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
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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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