From 4036cfa1a7b438e2a6b36c38893e9175d1b141f1 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 10 Oct 2023 20:00:15 +0530 Subject: [PATCH] install ruby into cloudron home dir --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index dabf895..78e8d46 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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