test
Some checks failed
CI / build (push) Has been cancelled

This commit is contained in:
2025-09-18 21:50:16 +02:00
parent 74aae300d8
commit b8b3384e67

View File

@ -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"]