Skip to content

Instantly share code, notes, and snippets.

@gottfrois
Last active September 6, 2018 09:07
Show Gist options
  • Save gottfrois/8f16b583f04e86969de37034bccbf0ae to your computer and use it in GitHub Desktop.
Save gottfrois/8f16b583f04e86969de37034bccbf0ae to your computer and use it in GitHub Desktop.
medium-multi-stage-dockerfile-full-classic-dockerfile
FROM ruby:2.5.1-alpine3.7
WORKDIR /home/app
RUN apk add --update --no-cache \
build-base \
libxml2-dev \
libxslt-dev \
nodejs \
tzdata
COPY Gemfile* /home/app/
RUN bundle config build.nokogiri --use-system-libraries \
&& bundle install --deployment --without development test --jobs 4 --retry 3
COPY . /home/app
ARG ASSET_HOST
ARG ENV=production
RUN ASSET_HOST=$ASSET_HOST \
RAILS_ENV=$ENV \
bundle exec rake assets:precompile
ENV PORT 3000
EXPOSE 3000
ENTRYPOINT ["bundle", "exec"]
CMD ["puma", "-C", "config/puma.rb"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment