Skip to content

Commit

Permalink
Dockerfile updates to follow Rails 7.2 (#2428)
Browse files Browse the repository at this point in the history
  • Loading branch information
pglombardo authored Aug 18, 2024
1 parent 2cd7000 commit 4113c7e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions containers/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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}/
Expand All @@ -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 ##################

Expand Down

0 comments on commit 4113c7e

Please sign in to comment.