Merge pull request #2174 from jzelinskie/pngcrush
dockerfile: optimize static images
This commit is contained in:
commit
b671ee938a
1 changed files with 8 additions and 1 deletions
|
@ -16,6 +16,7 @@ RUN apt-get install -y \
|
||||||
gdb \
|
gdb \
|
||||||
gdebi-core \
|
gdebi-core \
|
||||||
git \
|
git \
|
||||||
|
jpegoptim \
|
||||||
libevent-2.0.5 \
|
libevent-2.0.5 \
|
||||||
libevent-dev \
|
libevent-dev \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
|
@ -36,6 +37,7 @@ RUN apt-get install -y \
|
||||||
nginx \
|
nginx \
|
||||||
nodejs \
|
nodejs \
|
||||||
npm \
|
npm \
|
||||||
|
optipng \
|
||||||
python-dbg \
|
python-dbg \
|
||||||
python-dev \
|
python-dev \
|
||||||
python-pip \
|
python-pip \
|
||||||
|
@ -102,7 +104,12 @@ RUN cd grunt && npm install
|
||||||
# Run grunt
|
# Run grunt
|
||||||
RUN cd grunt && grunt
|
RUN cd grunt && grunt
|
||||||
|
|
||||||
RUN apt-get remove -y --auto-remove python-dev g++ libjpeg62-dev libevent-dev libldap2-dev libsasl2-dev libpq-dev libffi-dev libgpgme11-dev nodejs npm
|
# Optimize our images
|
||||||
|
ADD static/img static/img
|
||||||
|
RUN jpegoptim static/img/**/*.jpg
|
||||||
|
RUN optipng -clobber -quiet static/img/**/*.png
|
||||||
|
|
||||||
|
RUN apt-get remove -y --auto-remove python-dev g++ libjpeg62-dev libevent-dev libldap2-dev libsasl2-dev libpq-dev libffi-dev libgpgme11-dev nodejs npm jpegoptim optipng
|
||||||
RUN apt-get autoremove -y
|
RUN apt-get autoremove -y
|
||||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
RUN rm -rf grunt
|
RUN rm -rf grunt
|
||||||
|
|
Reference in a new issue