Skip to content

Instantly share code, notes, and snippets.

@abimaelmartell
Created March 31, 2020 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abimaelmartell/af2f87ce25d3601abeb232695a22e7fd to your computer and use it in GitHub Desktop.
Save abimaelmartell/af2f87ce25d3601abeb232695a22e7fd to your computer and use it in GitHub Desktop.
Docker for Rails
FROM ruby:2.7.0-alpine
ENV PORT=80
RUN apk add --no-cache \
build-base \
libxml2-dev \
libxslt-dev \
postgresql-dev \
tzdata
WORKDIR /app
ADD Gemfile* /app/
ENV RAILS_ENV production
RUN bundle install --deployment --without development test --jobs 20 --retry 5
COPY . /app
EXPOSE $PORT
CMD bin/entry.sh
#!/bin/sh
set -e
bundle exec rake tmp:create
bundle exec rake db:migrate
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