Basically, the same alpine ruby images, but with few of changes:
postgresql-client,xz-libs,tzdatapackages are preinstalledspace_efficient_bundle_installscript addedspace_efficient_assets_precompilescript added
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
This script installs Nodejs & Yarn for rake assets:precompile and cleanups afterwards (including node_modules & yarn cache dirs).
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_precompileTARGET_VERSION=2.7.1-alpine make