Remove unused libraries and files from Docker image

This commit is contained in:
Patrick Gansterer 2017-08-02 21:02:39 +02:00
parent 5903b4d601
commit c3a49e4260
2 changed files with 10 additions and 7 deletions

View file

@ -3,6 +3,7 @@
.sass-cache
log
config/database.yml
doc
public/assets
public/system
tmp/*

View file

@ -1,11 +1,7 @@
FROM ruby:2.3
RUN apt-get update && \
apt-get install --no-install-recommends -y \
cron \
libv8-dev \
libmagic-dev \
libmysqlclient-dev && \
apt-get install --no-install-recommends -y cron && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean
@ -13,8 +9,14 @@ ENV RAILS_ENV=production
WORKDIR /usr/src/app
COPY . ./
RUN echo $SOURCE_COMMIT > REVISION && \
bundle install --without development --without test && \
RUN echo $SOURCE_COMMIT > REVISION
RUN buildDeps='libmagic-dev' && \
apt-get update && \
apt-get install --no-install-recommends -y $buildDeps && \
rm -rf /var/lib/apt/lists/* && \
bundle install --deployment --without development test && \
apt-get purge -y --auto-remove $buildDeps && \
whenever --update-crontab
EXPOSE 3000