Skip to content

Instantly share code, notes, and snippets.

@bbonislawski
Created May 28, 2017 18:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bbonislawski/d2c2f08e68e344d17e7beb7434b384ac to your computer and use it in GitHub Desktop.
Save bbonislawski/d2c2f08e68e344d17e7beb7434b384ac to your computer and use it in GitHub Desktop.
Dockerfile for rails api with alpine image
FROM ruby:2.4.1-alpine
RUN set -x \
&& apk upgrade --no-cache \
&& apk add --no-cache --virtual build-dependencies \
build-base libc-dev linux-headers tzdata \
openssl-dev postgresql-dev \
&& apk add --no-cache \
libxml2-dev \
libxslt-dev \
&& gem install nokogiri \
-- --use-system-libraries \
--with-xml2-config=/usr/bin/xml2-config \
--with-xslt-config=/usr/bin/xslt-config
RUN mkdir /app_name_api
WORKDIR /app_name_api
ADD Gemfile /app_name_api/Gemfile
ADD Gemfile.lock /app_name_api/Gemfile.lock
RUN bundle install
ADD . /app_name_api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment