Created
November 20, 2018 04:34
-
-
Save makevoid/07b3b3c807cbee982659bb189d104850 to your computer and use it in GitHub Desktop.
Ruby 2.5 Dockerfile - using multi staged builds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM ubuntu:cosmic as ruby | |
| RUN apt update -y | |
| RUN apt install -y ruby-dev git | |
| RUN gem i bundler | |
| FROM ruby as ruby-build | |
| RUN apt install -y build-essential | |
| FROM ruby-build as builder | |
| WORKDIR /app | |
| RUN mkdir -p /app/.bundle | |
| ADD .bundle/config-docker .bundle/config | |
| ADD Gemfile* /app/ | |
| RUN bundle --deployment | |
| ENV RACK_ENV production | |
| RUN ls vendor | |
| ADD . /app | |
| FROM ruby | |
| COPY --from=builder /app /app | |
| WORKDIR /app | |
| CMD bundle exec rackup -o 0.0.0.0 -p 3000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment