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 .sass-cache
log log
config/database.yml config/database.yml
doc
public/assets public/assets
public/system public/system
tmp/* tmp/*

View file

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