Skip to content

Instantly share code, notes, and snippets.

@atomaka
Last active March 1, 2017 03:19
Show Gist options
  • Save atomaka/f213d7f06576d63d1d5f035f3616ed96 to your computer and use it in GitHub Desktop.
Save atomaka/f213d7f06576d63d1d5f035f3616ed96 to your computer and use it in GitHub Desktop.
Simple production Dockerfile
FROM ruby:2.3-alpine
ADD Gemfile* /app/
RUN apk add --no-cache --virtual .build-deps build-base \
&& apk add --no-cache postgresql-dev tzdata \
&& cd /app; bundle install --without test production \
&& apk del .build-deps
ADD . /app
RUN chown -R nobody:nogroup /app
USER nobody
ENV RAILS_ENV production
WORKDIR /app
CMD ["bundle", "exec", "rails", "s", "-b", "0.0.0.0", "-p", "8080"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment