chore(dockerfile): reduce container size

This commit is contained in:
Adam Cooke
2025-10-01 18:12:26 +01:00
parent 7c47422c86
commit 86de372382
+15 -8
View File
@@ -1,18 +1,25 @@
FROM ruby:3.4.6-bookworm AS base FROM ruby:3.4.6-slim-bookworm AS base
SHELL ["/bin/bash", "-o", "pipefail", "-c"] SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update \
&& apt-get install --no-install-recommends -y curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN (curl -sL https://deb.nodesource.com/setup_20.x | bash -) RUN (curl -sL https://deb.nodesource.com/setup_20.x | bash -)
# Install main dependencies # Install main dependencies
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
build-essential \ build-essential \
netcat-openbsd \ netcat-openbsd \
curl \ libmariadb-dev \
libmariadb-dev \ libcap2-bin \
libcap2-bin \ nano \
nano \ libyaml-dev \
nodejs nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/ruby RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/ruby