Skip to content

Instantly share code, notes, and snippets.

@danielalvarenga
Created March 8, 2018 15:48
Show Gist options
  • Save danielalvarenga/fd908026059b82d78b70e0ac50c8c76c to your computer and use it in GitHub Desktop.
Save danielalvarenga/fd908026059b82d78b70e0ac50c8c76c to your computer and use it in GitHub Desktop.
Dockerfile for rails application with alpine linux
FROM ruby:2.5-alpine3.7
RUN apk add --update --no-cache \
build-base \
nodejs \
tzdata \
libxml2-dev \
libxslt-dev \
bash \
postgresql-dev \
mysql-dev
ARG rails_env=development
ENV APP_ROOT /app
RUN mkdir $APP_ROOT
WORKDIR $APP_ROOT
RUN bundle config --global frozen 1
COPY Gemfile $APP_ROOT/Gemfile
COPY Gemfile.lock $APP_ROOT/Gemfile.lock
RUN RAILS_ENV=$rails_env_variable bundle install --path /bundle
COPY . $APP_ROOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment