Sha256: 41995909ffbef62395eb6e10bfb7fbc1c085dd5bf501c7bd20adceb573720402

Contents?: true

Size: 1.44 KB

Versions: 1

Compression:

Stored size: 1.44 KB

Contents

# =============================================================================
# Target: base

FROM ruby:3.0.2-alpine AS base

RUN apk --no-cache --update upgrade && \
    apk --no-cache add \
        bash \
        ca-certificates \
        git \
        libc6-compat \
        openssl \
        tzdata \
        xz-libs \
    && rm -rf /var/cache/apk/*

WORKDIR /opt/app

# =============================================================================
# Target: development
#

FROM base AS development

# Install system packages needed to build gems with C extensions.
RUN apk --update --no-cache add \
        build-base \
        coreutils \
        git \
    && rm -rf /var/cache/apk/*

# Copy codebase to WORKDIR. Unlike application projects, for a gem project
# we need to do this before running `bundle install`, in order for the gem
# we're building to be able to "install" itself.
COPY . .

# Install gems.
RUN bundle install --path=/usr/local/bundle

# =============================================================================
# Target: production

FROM base AS production

# Copy the built codebase from the dev stage
COPY --from=development /opt/app /opt/app
COPY --from=development /usr/local/bundle /usr/local/bundle

# Sanity-check that everything was installed correctly and still runs in the
# slimmed-down production image.
RUN bundle config set deployment 'true'
RUN bundle install --local --path=/usr/local/bundle

CMD ['bundle', 'exec', 'rake']

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
berkeley_library-alma-0.0.1 Dockerfile