Repository navigation
Expand file tree
/
Copy pathDockerfile.test
More file actions
81 lines (62 loc) · 3.15 KB
/
Copy pathDockerfile.test
File metadata and controls
81 lines (62 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#syntax=docker/dockerfile:1
ARG RUBY_VERSION=4.0.10
# Build from the SHA256-verified official release archive.
FROM debian:trixie-slim AS ruby-build
ARG RUBY_VERSION
ARG RUBY_SHA256=1537f7a6003c436546ecab6b48b6e7725a9af2328f45a8af7f42f41c5df90ab8
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential ca-certificates curl \
libffi-dev libgmp-dev libreadline-dev libssl-dev libyaml-dev ruby rustc xz-utils zlib1g-dev && \
curl -fsSL "https://cache.ruby-lang.org/pub/ruby/4.0/ruby-${RUBY_VERSION}.tar.xz" -o /tmp/ruby.tar.xz && \
echo "${RUBY_SHA256} /tmp/ruby.tar.xz" | sha256sum -c - && \
mkdir /tmp/ruby && tar -xJf /tmp/ruby.tar.xz -C /tmp/ruby --strip-components=1 && \
cd /tmp/ruby && \
LDFLAGS="-Wl,-z,relro -Wl,-z,now" ./configure --enable-shared --enable-yjit --disable-install-doc && \
make -j 4 && make install
FROM debian:trixie-slim AS base
ARG RUBY_VERSION
ENV LANG=C.UTF-8 \
GEM_HOME=/usr/local/bundle \
BUNDLE_APP_CONFIG=/usr/local/bundle \
BUNDLE_SILENCE_ROOT_WARNING=1
ENV PATH=/usr/local/bundle/bin:$PATH
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y ca-certificates libcrypt1 libffi8 \
libgmp10 libreadline8t64 libssl3t64 libyaml-0-2 zlib1g && \
rm -rf /var/lib/apt/lists/*
COPY --from=ruby-build /usr/local/ /usr/local/
RUN ldconfig && mkdir -p /usr/local/bundle && chmod 1777 /usr/local/bundle && \
ruby -ropenssl -rpsych -rzlib -e 'abort "Unexpected Ruby" unless RUBY_VERSION == ARGV.fetch(0); abort "YJIT unavailable" unless RubyVM::YJIT.respond_to?(:enable)' "${RUBY_VERSION}"
ARG NODE_VERSION=24.22.1
ARG NODESOURCE_SETUP_SHA256=6e3d580f5bd7ccf2aa1e8df8d35c60d78e873c3ff8beb282c9bebd914904ad72
RUN mkdir /app
WORKDIR /app
RUN mkdir -p tmp/pids
RUN apt-get update && apt-get install -y --no-install-recommends curl gnupg2 && \
curl -fsSL https://deb.nodesource.com/setup_24.x -o /tmp/nodesource_setup.sh && \
echo "${NODESOURCE_SETUP_SHA256} /tmp/nodesource_setup.sh" | sha256sum -c - && \
bash /tmp/nodesource_setup.sh && \
rm /tmp/nodesource_setup.sh && \
apt-get install -y --no-install-recommends nodejs && \
npm install -g pnpm@9.15.9 && \
npm --version && \
apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
RUN apt-get update && apt-get install -y --no-install-recommends chromium chromium-sandbox postgresql-client poppler-utils qpdf && \
apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
FROM base AS build-deps
RUN apt-get update && apt-get install -y --no-install-recommends git build-essential libpq-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
FROM build-deps AS gems
RUN gem install bundler -v 4.0.20
COPY Gemfile Gemfile.lock ./
RUN bundle install && rm -rf vendor/bundle/ruby/*/cache
FROM base AS node_modules
COPY package.json pnpm-lock.yaml ./
COPY patches ./patches
RUN pnpm install --frozen-lockfile --ignore-scripts
FROM base
COPY --from=gems /app /app
COPY --from=gems /usr/local/bundle /usr/local/bundle
COPY --from=node_modules /app/node_modules /app/node_modules
COPY . ./
RUN ["chmod", "+x", "scripts/ci/rspec.sh"]