Attempt to speed up builds by putting coolify...

tools in separate base image
This commit is contained in:
Max Wofford 2025-04-11 12:01:37 -04:00
parent 9fb4949843
commit 85cbe5b00e

View file

@ -7,6 +7,13 @@
# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html
# Create a minimal image with curl and wget
FROM debian:bullseye-slim as tools
RUN apt-get update && \
apt-get install -y --no-install-recommends curl wget && \
rm -rf /var/lib/apt/lists/*
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
ARG RUBY_VERSION=3.4.1
FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
@ -17,15 +24,15 @@ WORKDIR /rails
# Install base packages
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y \
curl \
libjemalloc2 \
libvips \
sqlite3 \
libpq5 \
vim \
wget && \
# sqlite3 \
libpq5 && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives
COPY --from=tools /usr/bin/curl /usr/bin/curl
COPY --from=tools /usr/bin/wget /usr/bin/wget
# Set production environment
ENV RAILS_ENV="production" \
BUNDLE_DEPLOYMENT="1" \