Revert "Attempt to speed up production builds by skipping apt update (#144)"

This reverts commit 65b61dc241.
This commit is contained in:
Max Wofford
2025-03-30 22:12:57 -04:00
parent 0c1aecc760
commit 91c802d5e7

View File

@@ -15,14 +15,16 @@ FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
WORKDIR /rails
# Install base packages
RUN apt-get install --no-install-recommends -y \
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
curl \
libjemalloc2 \
libvips \
sqlite3 \
libpq5 \
vim \
wget
wget && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
# Set production environment
ENV RAILS_ENV="production" \
@@ -33,12 +35,10 @@ ENV RAILS_ENV="production" \
# Throw-away build stage to reduce size of final image
FROM base AS build
# Install build dependencies
RUN apt-get install --no-install-recommends -y \
build-essential \
git \
pkg-config \
libpq-dev
# Install packages needed to build gems
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential git pkg-config libpq-dev && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
# Install application gems
COPY Gemfile Gemfile.lock ./