-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Dockerfile for Ruby 3.3 with required dependencies and impro…
…ved file copying
- Loading branch information
1 parent
685afb5
commit dc938d0
Showing
1 changed file
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |