3
3
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
4
4
ARG RUBY_VERSION=3.2.5
5
5
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
6
- ARG NODE_VERSION=16.20.2-1nodesource1
7
6
8
7
# Rails app lives here
9
8
WORKDIR /enju
@@ -17,17 +16,16 @@ ENV RAILS_ENV="production" \
17
16
18
17
# Throw-away build stage to reduce size of final image
19
18
FROM base as build
20
- ARG NODE_VERSION=16.20.2-1nodesource1
21
19
22
20
# Install packages needed to build gems
23
21
RUN apt-get update -qq && apt-get install --no-install-recommends -y curl gnupg && \
24
22
mkdir -p /etc/apt/keyrings && \
25
23
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
26
24
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor -o /etc/apt/keyrings/yarnkey.gpg && \
27
- echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16 .x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
25
+ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20 .x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
28
26
echo "deb [signed-by=/etc/apt/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list && \
29
27
apt-get update -qq && \
30
- apt-get install --no-install-recommends -y build-essential git libpq-dev libvips pkg-config nodejs=${NODE_VERSION} yarn
28
+ apt-get install --no-install-recommends -y build-essential git libpq-dev libvips pkg-config nodejs yarn
31
29
32
30
# Install application gems
33
31
COPY Gemfile Gemfile.lock ./
@@ -43,6 +41,7 @@ COPY . .
43
41
RUN bundle exec bootsnap precompile app/ lib/
44
42
45
43
# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
44
+ ARG NODE_OPTIONS=--openssl-legacy-provider
46
45
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
47
46
48
47
@@ -58,10 +57,10 @@ RUN apt-get update -qq && apt-get install --no-install-recommends -y curl gnupg
58
57
mkdir -p /etc/apt/keyrings && \
59
58
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
60
59
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor -o /etc/apt/keyrings/yarnkey.gpg && \
61
- echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16 .x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
60
+ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20 .x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
62
61
echo "deb [signed-by=/etc/apt/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list && \
63
62
apt-get update -qq && \
64
- apt-get install --no-install-recommends -y libvips postgresql-client nodejs=${NODE_VERSION} yarn && \
63
+ apt-get install --no-install-recommends -y libvips postgresql-client nodejs yarn && \
65
64
rm -rf /var/lib/apt/lists /var/cache/apt/archives
66
65
67
66
# Copy built artifacts: gems, application
0 commit comments