From b8b3384e6758e6bdd65a24fe756093a6671b0a62 Mon Sep 17 00:00:00 2001 From: Rene Date: Thu, 18 Sep 2025 21:50:16 +0200 Subject: [PATCH] test --- Dockerfile | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 10ccb48..ad6c0c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,27 +9,24 @@ RUN apt-get update -qq && \ useradd --user-group --create-home --shell /bin/false app ENV HOME=/home/app -# After setting WORKDIR and USER app WORKDIR $HOME/wedding -# Create node_modules owned by app -RUN mkdir -p node_modules && chown -R app:app node_modules -USER app - -# Copy Gemfiles and install Ruby deps +# Copy only Gemfiles first to leverage Docker caching COPY --chown=app:app Gemfile Gemfile.lock ./ RUN bundle install -# Copy the rest of the app +# Copy rest of the app COPY --chown=app:app . ./ -# Ensure node_modules directory is owned by app -RUN mkdir -p node_modules && chmod -R 755 node_modules +# Make absolutely sure everything belongs to app +RUN chown -R app:app $HOME/wedding -# Install JS deps before assets:precompile +USER app + +# Install JS dependencies RUN yarn install --check-files -# Compile assets +# Precompile Rails assets (SCSS -> CSS, JS, images) RUN bundle exec rake assets:precompile CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]