Skip to content

Commit

Permalink
Update Docker iamge to use Ruby 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Dec 30, 2024
1 parent 616ec5d commit f2a6c17
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NAME: homeland/homeland
FROM homeland/base:3.3-alpine
FROM homeland/base:3.4-alpine

ENV RAILS_ENV "production"
ENV RUBY_YJIT_ENABLE "true"
Expand All @@ -8,23 +8,22 @@ WORKDIR /home/app/homeland
VOLUME /home/app/homeland/plugins

RUN mkdir -p /home/app &&\
rm -rf '/tmp/*' &&\
rm -rf /etc/nginx/conf.d/default.conf
rm -rf '/tmp/*' &&\
rm -rf /etc/nginx/conf.d/default.conf

RUN gem install bundler
ADD Gemfile Gemfile.lock package.json yarn.lock /home/app/homeland/
# Do not enable bundle deployment, use globalize mode, Puma tmp_restart need it.
RUN bundle install && yarn && \
find /usr/local/bundle -name tmp -type d -exec rm -rf {} + && \
find /usr/local/bundle -name "*.gem" -type f -exec rm -rf {} + && \
find /usr/local/lib/ruby -name "*.gem" -type f -exec rm -rf {} + && \
rm -Rf /usr/local/share/.cache/ && \
rm -Rf /root/.cargo/registry/cache
find /usr/local/bundle -name tmp -type d -exec rm -rf {} + && \
find /usr/local/bundle -name "*.gem" -type f -exec rm -rf {} + && \
find /usr/local/lib/ruby -name "*.gem" -type f -exec rm -rf {} + && \
rm -Rf /usr/local/share/.cache/ && \
rm -Rf /root/.cargo/registry/cache

ADD . /home/app/homeland
ADD ./config/nginx/ /etc/nginx

RUN bundle exec rails assets:precompile RAILS_PRECOMPILE=1 RAILS_ENV=production SECRET_KEY_BASE=fake
RUN rm -Rf /home/app/homeland/app/javascript && \
rm -Rf /home/app/homeland/test

rm -Rf /home/app/homeland/test
2 changes: 1 addition & 1 deletion Dockerfile-base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.3-alpine
FROM ruby:3.4-alpine

RUN apk update && apk add curl gcc g++ gnupg make

Expand Down

0 comments on commit f2a6c17

Please sign in to comment.