Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

Commit

Permalink
Reduce docker image size
Browse files Browse the repository at this point in the history
  • Loading branch information
vterdunov committed Apr 6, 2018
1 parent 008af4c commit bf99c62
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
FROM ruby:2.4.2-alpine3.6
FROM ruby:2.4.4-alpine3.6

ENV LANG C.UTF-8
ENV APP_HOME /janna
WORKDIR /janna

ARG PACKAGES=' \
ARG BUILD_DEPS=' \
ruby-dev \
build-base \
curl \
libxml2-dev \
libxslt-dev \
libffi-dev'

RUN apk add --no-cache --update $PACKAGES && \
rm -rf /var/cache/apk/*
ARG RUNTIME_DEPS=' \
curl'

ENV LANG C.UTF-8

WORKDIR $APP_HOME
COPY Gemfile $APP_HOME
COPY Gemfile.lock $APP_HOME
RUN bundle install --jobs=4 --retry=4
RUN apk add --no-cache $RUNTIME_DEPS

COPY Gemfile.lock .
COPY Gemfile .

RUN apk add --no-cache --virtual .build-deps $BUILD_DEPS && \
bundle install --jobs=4 --retry=4 && \
apk del .build-deps && \
rm -rf /var/cache/apk/*

COPY . $APP_HOME
COPY . .

ENTRYPOINT ["bundle", "exec"]
CMD ["shotgun", "--server", "puma", "--host", "0.0.0.0", "--port", "4567"]

0 comments on commit bf99c62

Please sign in to comment.