install ruby into cloudron home dir

This commit is contained in:
Girish Ramakrishnan 2023-10-10 20:00:15 +05:30
parent 27d68b5c35
commit 4036cfa1a7

View file

@ -20,14 +20,13 @@ RUN apt-get update && \
# install rbenv since we need ruby 3.0.4
RUN mkdir -p /usr/local/rbenv && curl -LSs "https://github.com/rbenv/rbenv/archive/refs/tags/v1.2.0.tar.gz" | tar -xz -C /usr/local/rbenv --strip-components 1 -f -
ENV PATH /usr/local/rbenv/bin:$PATH
ENV RBENV_ROOT /home/cloudron/rbenv
RUN mkdir -p "$(rbenv root)"/plugins/ruby-build && curl -LSs "https://github.com/rbenv/ruby-build/archive/refs/tags/v20221101.tar.gz" | tar -xz -C "$(rbenv root)"/plugins/ruby-build --strip-components 1 -f -
# install specific ruby version (https://github.com/mastodon/mastodon/blob/main/Dockerfile)
ARG RUBY_VERSION=3.0.4
RUN rbenv install ${RUBY_VERSION}
# this allows cloudron user to access ruby
RUN chmod o+rx /root
ENV PATH /root/.rbenv/versions/${RUBY_VERSION}/bin:$PATH
ENV PATH ${RBENV_ROOT}/versions/${RUBY_VERSION}/bin:$PATH
RUN gem install --no-document bundler
@ -41,6 +40,8 @@ RUN curl -L https://github.com/tootsuite/mastodon/archive/v${VERSION}.tar.gz | t
bundle config --local set without 'development test' && \
bundle config --local set silence_root_warning true && \
bundle install && \
bundle clean --force && \
rm -rf ~/.bundle /usr/local/bundle/cache && \
yarn install --pure-lockfile
# secret keys are not built into assets, so precompiling is safe to do here