-
Notifications
You must be signed in to change notification settings - Fork 369
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerfile updates to follow Rails 7.2 (#2428)
- Loading branch information
1 parent
2cd7000
commit 4113c7e
Showing
1 changed file
with
11 additions
and
8 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 |
---|---|---|
|
@@ -8,7 +8,7 @@ FROM ruby:3.3-alpine AS build-env | |
ARG BUNDLE_WITHOUT | ||
ARG BUNDLE_DEPLOYMENT | ||
|
||
LABEL org.opencontainers.image.authors ='[email protected]' | ||
LABEL org.opencontainers.image.authors='[email protected]' | ||
|
||
# Required packages | ||
RUN apk add --no-cache \ | ||
|
@@ -34,6 +34,12 @@ RUN bundle config set without "${BUNDLE_WITHOUT}" \ | |
&& bundle config set deployment "${BUNDLE_DEPLOYMENT}" \ | ||
&& bundle install | ||
|
||
# Removing unneccesary files/directories | ||
RUN rm -rf vendor/bundle/ruby/*/cache \ | ||
&& rm -rf vendor/bundle/ruby/*/bundler/gems/*/.git \ | ||
&& find vendor/bundle/ruby/*/gems/ -name "*.c" -delete \ | ||
&& find vendor/bundle/ruby/*/gems/ -name "*.o" -delete | ||
|
||
RUN yarn install | ||
|
||
COPY ./ ${APP_ROOT}/ | ||
|
@@ -52,13 +58,10 @@ ENV DATABASE_URL=sqlite3:db/db.sqlite3 | |
# SECRET_KEY_BASE=<value> | ||
ENV SECRET_KEY_BASE=662e5f1c1f71b78c6fc0455cf72b590aefc7e924bbe356556c8dacd18fa0c6a5d7d4908afc7627bd1d6cb5ce95b610eeb64f538079d1fe07ef3d73b43ac0f8b0 | ||
|
||
RUN bundle exec rails assets:precompile && bundle exec rake db:setup | ||
|
||
# Removing unneccesary files/directories | ||
RUN rm -rf tmp/cache vendor/assets spec \ | ||
&& rm -rf vendor/bundle/ruby/*/cache/*.gem \ | ||
&& find vendor/bundle/ruby/*/gems/ -name "*.c" -delete \ | ||
&& find vendor/bundle/ruby/*/gems/ -name "*.o" -delete | ||
RUN bundle exec bootsnap precompile --gemfile | ||
RUN bundle exec bootsnap precompile app/ lib/ | ||
RUN bundle exec rails assets:precompile | ||
RUN bundle exec rake db:setup | ||
|
||
################## Build done ################## | ||
|
||
|