mirror of
https://github.com/mastodon/mastodon.git
synced 2025-11-27 18:10:58 +00:00
Update recommended Node version to 24 (LTS) (#36539)
This commit is contained in:
parent
b80ec3721d
commit
de80a54555
|
|
@ -14,9 +14,9 @@ ARG BASE_REGISTRY="docker.io"
|
||||||
# Ruby image to use for base image, change with [--build-arg RUBY_VERSION="3.4.x"]
|
# Ruby image to use for base image, change with [--build-arg RUBY_VERSION="3.4.x"]
|
||||||
# renovate: datasource=docker depName=docker.io/ruby
|
# renovate: datasource=docker depName=docker.io/ruby
|
||||||
ARG RUBY_VERSION="3.4.7"
|
ARG RUBY_VERSION="3.4.7"
|
||||||
# # Node.js version to use in base image, change with [--build-arg NODE_MAJOR_VERSION="20"]
|
# # Node.js version to use in base image, change with [--build-arg NODE_MAJOR_VERSION="22"]
|
||||||
# renovate: datasource=node-version depName=node
|
# renovate: datasource=node-version depName=node
|
||||||
ARG NODE_MAJOR_VERSION="22"
|
ARG NODE_MAJOR_VERSION="24"
|
||||||
# Debian image to use for base image, change with [--build-arg DEBIAN_VERSION="trixie"]
|
# Debian image to use for base image, change with [--build-arg DEBIAN_VERSION="trixie"]
|
||||||
ARG DEBIAN_VERSION="trixie"
|
ARG DEBIAN_VERSION="trixie"
|
||||||
# Node.js image to use for base image based on combined variables (ex: 20-trixie-slim)
|
# Node.js image to use for base image based on combined variables (ex: 20-trixie-slim)
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ ARG TARGETPLATFORM=${TARGETPLATFORM}
|
||||||
ARG BUILDPLATFORM=${BUILDPLATFORM}
|
ARG BUILDPLATFORM=${BUILDPLATFORM}
|
||||||
ARG BASE_REGISTRY="docker.io"
|
ARG BASE_REGISTRY="docker.io"
|
||||||
|
|
||||||
# Node version to use in base image, change with [--build-arg NODE_MAJOR_VERSION="20"]
|
# Node version to use in base image, change with [--build-arg NODE_MAJOR_VERSION="22"]
|
||||||
# renovate: datasource=node-version depName=node
|
# renovate: datasource=node-version depName=node
|
||||||
ARG NODE_MAJOR_VERSION="22"
|
ARG NODE_MAJOR_VERSION="24"
|
||||||
# Debian image to use for base image, change with [--build-arg DEBIAN_VERSION="trixie"]
|
# Debian image to use for base image, change with [--build-arg DEBIAN_VERSION="trixie"]
|
||||||
ARG DEBIAN_VERSION="trixie"
|
ARG DEBIAN_VERSION="trixie"
|
||||||
# Node image to use for base image based on combined variables (ex: 20-trixie-slim)
|
# Node image to use for base image based on combined variables (ex: 20-trixie-slim)
|
||||||
|
|
@ -32,20 +32,20 @@ ARG GID="991"
|
||||||
|
|
||||||
# Apply Mastodon build options based on options above
|
# Apply Mastodon build options based on options above
|
||||||
ENV \
|
ENV \
|
||||||
# Apply Mastodon version information
|
# Apply Mastodon version information
|
||||||
MASTODON_VERSION_PRERELEASE="${MASTODON_VERSION_PRERELEASE}" \
|
MASTODON_VERSION_PRERELEASE="${MASTODON_VERSION_PRERELEASE}" \
|
||||||
MASTODON_VERSION_METADATA="${MASTODON_VERSION_METADATA}" \
|
MASTODON_VERSION_METADATA="${MASTODON_VERSION_METADATA}" \
|
||||||
# Apply timezone
|
# Apply timezone
|
||||||
TZ=${TZ}
|
TZ=${TZ}
|
||||||
|
|
||||||
ENV \
|
ENV \
|
||||||
# Configure the IP to bind Mastodon to when serving traffic
|
# Configure the IP to bind Mastodon to when serving traffic
|
||||||
BIND="0.0.0.0" \
|
BIND="0.0.0.0" \
|
||||||
# Explicitly set PORT to match the exposed port
|
# Explicitly set PORT to match the exposed port
|
||||||
PORT=4000 \
|
PORT=4000 \
|
||||||
# Use production settings for Yarn, Node and related nodejs based tools
|
# Use production settings for Yarn, Node and related nodejs based tools
|
||||||
NODE_ENV="production" \
|
NODE_ENV="production" \
|
||||||
# Add Ruby and Mastodon installation to the PATH
|
# Add Ruby and Mastodon installation to the PATH
|
||||||
DEBIAN_FRONTEND="noninteractive"
|
DEBIAN_FRONTEND="noninteractive"
|
||||||
|
|
||||||
# Set default shell used for running commands
|
# Set default shell used for running commands
|
||||||
|
|
@ -56,29 +56,29 @@ ARG TARGETPLATFORM
|
||||||
RUN echo "Target platform is ${TARGETPLATFORM}"
|
RUN echo "Target platform is ${TARGETPLATFORM}"
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
# Remove automatic apt cache Docker cleanup scripts
|
# Remove automatic apt cache Docker cleanup scripts
|
||||||
rm -f /etc/apt/apt.conf.d/docker-clean; \
|
rm -f /etc/apt/apt.conf.d/docker-clean; \
|
||||||
# Sets timezone
|
# Sets timezone
|
||||||
echo "${TZ}" > /etc/localtime; \
|
echo "${TZ}" > /etc/localtime; \
|
||||||
# Creates mastodon user/group and sets home directory
|
# Creates mastodon user/group and sets home directory
|
||||||
groupadd -g "${GID}" mastodon; \
|
groupadd -g "${GID}" mastodon; \
|
||||||
useradd -l -u "${UID}" -g "${GID}" -m -d /opt/mastodon mastodon; \
|
useradd -l -u "${UID}" -g "${GID}" -m -d /opt/mastodon mastodon; \
|
||||||
# Creates symlink for /mastodon folder
|
# Creates symlink for /mastodon folder
|
||||||
ln -s /opt/mastodon /mastodon;
|
ln -s /opt/mastodon /mastodon;
|
||||||
|
|
||||||
# hadolint ignore=DL3008,DL3005
|
# hadolint ignore=DL3008,DL3005
|
||||||
RUN \
|
RUN \
|
||||||
# Mount Apt cache and lib directories from Docker buildx caches
|
# Mount Apt cache and lib directories from Docker buildx caches
|
||||||
--mount=type=cache,id=apt-cache-${TARGETPLATFORM},target=/var/cache/apt,sharing=locked \
|
--mount=type=cache,id=apt-cache-${TARGETPLATFORM},target=/var/cache/apt,sharing=locked \
|
||||||
--mount=type=cache,id=apt-lib-${TARGETPLATFORM},target=/var/lib/apt,sharing=locked \
|
--mount=type=cache,id=apt-lib-${TARGETPLATFORM},target=/var/lib/apt,sharing=locked \
|
||||||
# Upgrade to check for security updates to Debian image
|
# Upgrade to check for security updates to Debian image
|
||||||
apt-get update; \
|
apt-get update; \
|
||||||
apt-get dist-upgrade -yq; \
|
apt-get dist-upgrade -yq; \
|
||||||
apt-get install -y --no-install-recommends \
|
apt-get install -y --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
curl \
|
||||||
tzdata \
|
tzdata \
|
||||||
wget \
|
wget \
|
||||||
;
|
;
|
||||||
|
|
||||||
# Set /opt/mastodon as working directory
|
# Set /opt/mastodon as working directory
|
||||||
|
|
@ -91,19 +91,19 @@ COPY .yarn /opt/mastodon/.yarn
|
||||||
COPY ./streaming /opt/mastodon/streaming
|
COPY ./streaming /opt/mastodon/streaming
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
# Mount local Corepack and Yarn caches from Docker buildx caches
|
# Mount local Corepack and Yarn caches from Docker buildx caches
|
||||||
--mount=type=cache,id=corepack-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/corepack,sharing=locked \
|
--mount=type=cache,id=corepack-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/corepack,sharing=locked \
|
||||||
--mount=type=cache,id=yarn-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/yarn,sharing=locked \
|
--mount=type=cache,id=yarn-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/yarn,sharing=locked \
|
||||||
# Configure Corepack
|
# Configure Corepack
|
||||||
rm /usr/local/bin/yarn*; \
|
rm /usr/local/bin/yarn*; \
|
||||||
corepack enable; \
|
corepack enable; \
|
||||||
corepack prepare --activate;
|
corepack prepare --activate;
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
# Mount Corepack and Yarn caches from Docker buildx caches
|
# Mount Corepack and Yarn caches from Docker buildx caches
|
||||||
--mount=type=cache,id=corepack-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/corepack,sharing=locked \
|
--mount=type=cache,id=corepack-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/corepack,sharing=locked \
|
||||||
--mount=type=cache,id=yarn-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/yarn,sharing=locked \
|
--mount=type=cache,id=yarn-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/yarn,sharing=locked \
|
||||||
# Install Node packages
|
# Install Node packages
|
||||||
yarn workspaces focus --production @mastodon/streaming;
|
yarn workspaces focus --production @mastodon/streaming;
|
||||||
|
|
||||||
# Set the running user for resulting container
|
# Set the running user for resulting container
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user