Prepare Dockerfile for Node 26 (#38943)
This commit is contained in:
parent
2f1bbe051c
commit
d2f640272f
11
Dockerfile
11
Dockerfile
@ -340,10 +340,13 @@ COPY --from=node /usr/local/bin /usr/local/bin
|
|||||||
COPY --from=node /usr/local/lib /usr/local/lib
|
COPY --from=node /usr/local/lib /usr/local/lib
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
# Configure Corepack
|
# Mount local Corepack and Yarn caches from Docker buildx caches
|
||||||
rm /usr/local/bin/yarn*; \
|
--mount=type=cache,id=corepack-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/corepack,sharing=locked \
|
||||||
npm i -g corepack; \
|
--mount=type=cache,id=yarn-cache-${TARGETPLATFORM},target=/usr/local/share/.cache/yarn,sharing=locked \
|
||||||
corepack prepare --activate;
|
# Remove pre-installed Yarn binaries (only present on Node <26)
|
||||||
|
rm -f /usr/local/bin/yarn*; \
|
||||||
|
# Install Corepack
|
||||||
|
npm i -g corepack;
|
||||||
|
|
||||||
# hadolint ignore=DL3008
|
# hadolint ignore=DL3008
|
||||||
RUN \
|
RUN \
|
||||||
|
|||||||
@ -32,20 +32,18 @@ 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
|
|
||||||
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
|
|
||||||
TZ=${TZ}
|
TZ=${TZ}
|
||||||
|
|
||||||
|
# Configure the IP to bind Mastodon to when serving traffic
|
||||||
|
# Explicitly set PORT to match the exposed port
|
||||||
|
# Use production settings for Yarn, Node and related nodejs based tools
|
||||||
|
# Add Ruby and Mastodon installation to the PATH
|
||||||
ENV \
|
ENV \
|
||||||
# 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
|
|
||||||
PORT=4000 \
|
PORT=4000 \
|
||||||
# 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
|
|
||||||
DEBIAN_FRONTEND="noninteractive"
|
DEBIAN_FRONTEND="noninteractive"
|
||||||
|
|
||||||
# Set default shell used for running commands
|
# Set default shell used for running commands
|
||||||
@ -93,10 +91,10 @@ 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
|
# Remove pre-installed Yarn binaries (only present on Node <26)
|
||||||
rm /usr/local/bin/yarn*; \
|
rm -f /usr/local/bin/yarn*; \
|
||||||
npm i -g corepack; \
|
# Install Corepack
|
||||||
corepack prepare --activate;
|
npm i -g corepack;
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
# Mount Corepack and Yarn caches from Docker buildx caches
|
# Mount Corepack and Yarn caches from Docker buildx caches
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user