Skip to content

Commit

Permalink
Refactor Dockerfile for Ruby 3.3 with required dependencies and impro…
Browse files Browse the repository at this point in the history
…ved file copying
  • Loading branch information
rohitpaulk committed Aug 13, 2024
1 parent 685afb5 commit dc938d0
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions dockerfiles/ruby-3.3.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
# syntax=docker/dockerfile:1.7-labs
FROM ruby:3.3-alpine

# Required for installing the json/async gems
RUN apk add --no-cache \
build-base=0.5-r3 \
libssl3=3.3.1-r3 \
readline-dev=8.2.10-r0 \
zlib-dev=1.3.1-r1

# Re-build if Gemfile or Gemfile.lock changes
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Gemfile,Gemfile.lock"

WORKDIR /app

COPY Gemfile Gemfile.lock ./
RUN bundle install --verbose
# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
COPY --exclude=.git --exclude=README.md . /app

RUN bundle install --verbose

# Once the heavy steps are done, we can copy all files back
COPY . /app

0 comments on commit dc938d0

Please sign in to comment.