Skip to content

Instantly share code, notes, and snippets.

@atomaka
Created March 1, 2017 03:33
Show Gist options
  • Save atomaka/b99179992c5130cb0b51bf8638a9b605 to your computer and use it in GitHub Desktop.
Save atomaka/b99179992c5130cb0b51bf8638a9b605 to your computer and use it in GitHub Desktop.
Shared Dockerfile
FROM ruby:2.3-alpine
ARG BUNDLE_WITHOUT=test:development
ENV BUNDLE_WITHOUT ${BUNDLE_WITHOUT}
ADD Gemfile* /app/
RUN apk add --no-cache --virtual .build-deps build-base \
&& apk add --no-cache postgresql-dev tzdata \
&& cd /app; bundle install \
&& apk del .build-deps
ADD . /app
RUN chown -R nobody:nogroup /app
USER nobody
ARG RAILS_ENV=production
ENV RAILS_ENV ${RAILS_ENV}
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