Created
September 15, 2016 00:22
-
-
Save rachelmyers/34bb6561ba9c48ddf6a24691dabf30fd to your computer and use it in GitHub Desktop.
A Dockerfile for a Rails app
This file contains 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 ruby:2.3 | |
# Set the base directory used in any further RUN, COPY, and ENTRYPOINT | |
# commands. | |
RUN mkdir -p /app | |
WORKDIR /app | |
# Copy dependencies into the container | |
COPY Gemfile Gemfile.lock ./ | |
RUN gem install bundler && bundle install --jobs 20 --retry 5 --without development test | |
# Set the Rails environment to production | |
ENV RAILS_ENV production | |
ENV RACK_ENV production | |
# Copy the main application into the container | |
COPY . ./ | |
# Precompile the Rails assets | |
RUN bundle exec rake assets:precompile | |
# Start the application with Puma | |
CMD bundle exec puma -C config/puma.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment