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

This commit is contained in:
2025-09-18 22:13:14 +02:00
parent e3e5329937
commit 81731c3a14
3 changed files with 66 additions and 117 deletions

View File

@ -1,32 +1,19 @@
FROM ruby:2.7.8
# Point to Debian archive repos instead of the dead ones
RUN apt-get update -qq && \
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get install -y build-essential libpq-dev nodejs curl gnupg && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update -qq && apt-get install -y yarn && \
apt-get install -y build-essential libpq-dev nodejs && \
useradd --user-group --create-home --shell /bin/false app
ENV HOME=/home/app
WORKDIR $HOME/wedding
# Copy only Gemfiles first to leverage Docker caching
COPY --chown=app:app Gemfile Gemfile.lock ./
RUN bundle install
# Copy rest of the app
COPY --chown=app:app . ./
# Make absolutely sure everything belongs to app
RUN chown -R app:app $HOME/wedding
USER app
# Install JS dependencies
RUN yarn install --check-files
# Precompile Rails assets (SCSS -> CSS, JS, images)
RUN bundle exec rake assets:precompile
COPY --chown=app:app Gemfile Gemfile.lock $HOME/wedding/
WORKDIR $HOME/wedding
RUN bundle
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]
COPY --chown=app:app . $HOME/wedding/