Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.22 KB

Readme.md

File metadata and controls

44 lines (30 loc) · 1.22 KB

Alpine ruby images for Rails

Basically, the same alpine ruby images, but with few of changes:

  1. postgresql-client, xz-libs, tzdata packages are preinstalled
  2. space_efficient_bundle_install script added
  3. space_efficient_assets_precompile script added

space_efficient_bundle_install script

This script installs build dependencies for bundle install and cleanups afterwards. Default list:

  • make
  • gcc
  • libc-dev
  • libxml2-dev
  • libxslt-dev
  • postgresql-dev

You can pass extra dependencies. For example space_efficient_bundle_install git sqlite-dev

space_efficient_assets_precompile script

This script installs Nodejs & Yarn for rake assets:precompile and cleanups afterwards (including node_modules & yarn cache dirs).

Example Dockerfile for basic Rails application

FROM sharshenov/ruby-for-rails:2.6.5-alpine

COPY Gemfile Gemfile.lock ./
RUN space_efficient_bundle_install

ENV RAILS_ENV=production
ENV RAILS_LOG_TO_STDOUT=true

COPY . .

RUN space_efficient_assets_precompile

To add new version

TARGET_VERSION=2.7.1-alpine make