From c5a76dd4ed340e07ed300c23aceedff025e8539c Mon Sep 17 00:00:00 2001 From: Chirag-Bhatti Date: Wed, 9 Aug 2023 15:29:23 +0100 Subject: [PATCH] feat: remove unrequired directories and permissions --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index fadafaf62..991bcb50f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,9 +49,9 @@ CMD bundle exec rake parallel:setup && bundle exec rake parallel:spec FROM base as development # We expect the rake assets:precompile command to create these directories, but mkdir -p will create them if they don't already exist -RUN mkdir -p tmp log /home/nonroot/.cache/yarn /home/nonroot/.yarnrc /app/yarn-error.log -RUN touch spec/examples.txt +RUN mkdir -p tmp log RUN chown -R nonroot tmp log +RUN chown nonroot db/schema.rb RUN bundle config set without "test" RUN bundle install --jobs=4 --no-binstubs --no-cache @@ -63,9 +63,9 @@ CMD bundle exec rails s -e ${RAILS_ENV} -p ${PORT} --binding=0.0.0.0 FROM base as staging # We expect the rake assets:precompile command to create these directories, but mkdir -p will create them if they don't already exist -RUN mkdir -p tmp log /home/nonroot/.cache/yarn /home/nonroot/.yarnrc /app/yarn-error.log -RUN touch spec/examples.txt +RUN mkdir -p tmp log RUN chown -R nonroot tmp log +RUN chown nonroot db/schema.rb USER nonroot