dockerfile: optimize static images
This commit is contained in:
parent
b7aac159ae
commit
1d5de937c6
1 changed files with 8 additions and 1 deletions
|
@ -16,6 +16,7 @@ RUN apt-get install -y \
|
|||
gdb \
|
||||
gdebi-core \
|
||||
git \
|
||||
jpegoptim \
|
||||
libevent-2.0.5 \
|
||||
libevent-dev \
|
||||
libffi-dev \
|
||||
|
@ -36,6 +37,7 @@ RUN apt-get install -y \
|
|||
nginx \
|
||||
nodejs \
|
||||
npm \
|
||||
optipng \
|
||||
python-dbg \
|
||||
python-dev \
|
||||
python-pip \
|
||||
|
@ -101,7 +103,12 @@ RUN cd grunt && npm install
|
|||
# Run 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 clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
RUN rm -rf grunt
|
||||
|
|
Reference in a new issue