-
Notifications
You must be signed in to change notification settings - Fork 210
fix(rails): update Dockerfile #1580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,23 +7,38 @@ | |
FROM ruby:3.2-buster | ||
# [END cloudrun_rails_base_image] | ||
|
||
RUN (curl -sS https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | apt-key add -) && \ | ||
echo "deb https://deb.nodesource.com/node_20.x buster main" > /etc/apt/sources.list.d/nodesource.list && \ | ||
apt-get update && apt-get install -y nodejs lsb-release | ||
# Replace expired Buster repositories with archive.debian.org | ||
RUN sed -i 's|http://deb.debian.org/debian|http://archive.debian.org/debian|g' /etc/apt/sources.list && \ | ||
sed -i 's|http://security.debian.org/debian-security|http://archive.debian.org/debian-security|g' /etc/apt/sources.list && \ | ||
echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/10no-check-valid-until && \ | ||
apt-get update | ||
|
||
# Install Node.js (from NodeSource) | ||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | \ | ||
gpg --dearmor -o /usr/share/keyrings/nodesource.gpg && \ | ||
echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x buster main" > \ | ||
/etc/apt/sources.list.d/nodesource.list && \ | ||
apt-get update && \ | ||
apt-get install -y nodejs lsb-release | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: it would make more sense to install the lsb-release package in the same step that the repository is setup |
||
|
||
# Install Yarn | ||
RUN curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | \ | ||
gpg --dearmor -o /usr/share/keyrings/yarn.gpg && \ | ||
echo "deb [signed-by=/usr/share/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > \ | ||
/etc/apt/sources.list.d/yarn.list && \ | ||
apt-get update && \ | ||
apt-get install -y yarn | ||
|
||
RUN (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 && apt-get install -y yarn | ||
|
||
WORKDIR /app | ||
|
||
# Application dependencies | ||
COPY Gemfile Gemfile.lock ./ | ||
|
||
RUN gem install bundler && \ | ||
bundle config set --local deployment 'true' && \ | ||
bundle config set --local without 'development test' && \ | ||
bundle install | ||
bundle config set --local deployment 'true' && \ | ||
bundle config set --local without 'development test' && \ | ||
bundle install | ||
Comment on lines
-24
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: It's useful when using command continuations to use indenting to make it clear that this is all one layer, one run command. Please apply to other commands. |
||
|
||
|
||
# Copy application code to the container image | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: if there's an issue with buster, why not update the base image to bookworm? Does that version have the same issue?