Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FROM ruby:2.3
- MAINTAINER [email protected]
- # Install apt based dependencies required to run Rails as
- # well as RubyGems. As the Ruby image itself is based on a
- # Debian image, we use apt-get to install those.
- RUN apt-get update && apt-get install -y \
- build-essential \
- nodejs
- # Configure the main working directory. This is the base
- # directory used in any further RUN, COPY, and ENTRYPOINT
- # commands.
- RUN mkdir -p /app
- WORKDIR /app
- # Copy the Gemfile as well as the Gemfile.lock and install
- # the RubyGems. This is a separate step so the dependencies
- # will be cached unless changes to one of those two files
- # are made.
- COPY Gemfile Gemfile.lock ./
- RUN gem install bundler -v 1.17.3 && bundle install --jobs 20 --retry 5
- # Copy the main application.
- COPY . ./
- # Expose port 3000 to the Docker host, so we can access it
- # from the outside.
- EXPOSE 3000
- # Configure an entry point, so we don't need to specify
- # "bundle exec" for each of our commands.
- ENTRYPOINT ["bundle", "exec"]
- # The main command to run when the container starts. Also
- # tell the Rails dev server to bind to all interfaces by
- # default.
- CMD ["rails", "server", "-b", "0.0.0.0"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement