Skip to content

Instantly share code, notes, and snippets.

@tarla
Created July 31, 2016 16:36
Show Gist options
  • Save tarla/328157bc5d0739efbce2be5933990307 to your computer and use it in GitHub Desktop.
Save tarla/328157bc5d0739efbce2be5933990307 to your computer and use it in GitHub Desktop.
default ruby/rails Dockerfile with alpine
FROM ruby:2.3-alpine
MAINTAINER Joao Tarla <joao@tarla.com.br>
ENV BUILD_PACKAGES="curl-dev ruby-dev build-base bash" \
DEV_PACKAGES="zlib-dev libxml2-dev libxslt-dev tzdata yaml-dev postgresql-dev" \
RUBY_PACKAGES="ruby-json yaml nodejs"
RUN apk --update add --no-cache --update\
$BUILD_PACKAGES \
$DEV_PACKAGES \
$RUBY_PACKAGES && \
rm -rf /var/cache/apk/* && \
mkdir -p /usr/src/app
ONBUILD WORKDIR /usr/src/app
ONBUILD COPY . /usr/src/app
ONBUILD EXPOSE 9000
ONBUILD RUN bundle config build.nokogiri --use-system-libraries && \
bundle install && \
bundle clean
WORKDIR /usr/src/app/
CMD ["rails", "server", "-b", "0.0.0.0", "-p", "9000"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment