Sha256: 494253dc14c254d3f774031c10125e957451745052c14b22dfbee8658c6fa538

Contents?: true

Size: 1.48 KB

Versions: 9

Compression:

Stored size: 1.48 KB

Contents

# syntax = docker/dockerfile:1.4

ARG RUBY_VERSION=<%= RUBY_VERSION %>

FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base

LABEL description="<%= [settings.organization_label, "Application"].compact.join " " %>"
LABEL maintainer="<%= settings.author_name %> <<%= settings.author_email %>>"

WORKDIR /app

RUN <<STEPS
  apt-get update -qq \
  && apt-get install --no-install-recommends -y curl libjemalloc2 \
  && rm -rf /var/lib/apt/lists /var/cache/apt/archives
STEPS

ENV RACK_ENV=production
ENV BUNDLE_DEPLOYMENT=1
ENV BUNDLE_PATH=/usr/local/bundle
ENV BUNDLE_WITHOUT="development:quality:test:tools"

FROM base AS build

RUN <<STEPS
  apt-get update -qq \
  && apt-get install --no-install-recommends -y build-essential git pkg-config \
  && rm -rf /var/lib/apt/lists /var/cache/apt/archives
STEPS

COPY .ruby-version Gemfile Gemfile.lock ./

RUN <<STEPS
  bundle install
  rm -rf "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git
<% if settings.build_bootsnap %>
  bundle exec bootsnap precompile --gemfile
<% end %>
STEPS

COPY . .
<% if settings.build_bootsnap %>
RUN bundle exec bootsnap precompile app/ lib/ slices/
<% end %>
FROM base
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
COPY --from=build /app /app

RUN <<STEPS
  mkdir -p /app/log
  mkdir -p /app/tmp
STEPS

RUN groupadd --system --gid 1000 app && \
    useradd app --uid 1000 --gid 1000 --create-home --shell /bin/bash && \
    chown -R app:app log tmp

USER 1000:1000

ENTRYPOINT ["/app/bin/docker/entrypoint"]

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rubysmith-8.1.0 lib/rubysmith/templates/%project_name%/Dockerfile.erb
rubysmith-8.0.0 lib/rubysmith/templates/%project_name%/Dockerfile.erb
rubysmith-7.9.0 lib/rubysmith/templates/%project_name%/Dockerfile.erb
rubysmith-7.8.0 lib/rubysmith/templates/%project_name%/Dockerfile.erb
rubysmith-7.7.0 lib/rubysmith/templates/%project_name%/Dockerfile.erb
rubysmith-7.6.0 lib/rubysmith/templates/%project_name%/Dockerfile.erb
rubysmith-7.5.0 lib/rubysmith/templates/%project_name%/Dockerfile.erb
rubysmith-7.4.0 lib/rubysmith/templates/%project_name%/Dockerfile.erb
rubysmith-7.3.0 lib/rubysmith/templates/%project_name%/Dockerfile.erb