Commit bcbf2d1

mo <mo.khan@gmail.com>
2018-10-21 02:25:35
shrink the image by about 100MB
1 parent 69597f5
Changed files (1)
Dockerfile
@@ -3,12 +3,16 @@ ENV RAILS_ENV production
 ENV RAILS_LOG_TO_STDOUT true
 ENV RAILS_SERVE_STATIC_FILES true
 ENV PACKAGES build-base libxml2-dev tzdata postgresql-dev
-RUN apk update && apk upgrade && apk add $PACKAGES && rm -fr /var/cache/apk/*
 ADD *.tar.gz .
 RUN ln -s /proof-* /app
 WORKDIR /app
-RUN bundle install --deployment --jobs "$(nproc)" --local
-RUN apk del build-base
+RUN apk update && \
+    apk upgrade && \
+    apk add $PACKAGES && \
+    rm -fr /var/cache/apk/* && \
+    bundle install --deployment --jobs "$(nproc)" --local && \
+    apk del build-base && \
+    rm -fr vendor/cache
 RUN adduser -D -u 1000 rails && chown -R rails:rails /app/
 USER rails
 ENTRYPOINT ["bundle", "exec"]