Skip to content

Commit

Permalink
fix(build): env path fix for Node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jokesterfr committed Dec 8, 2023
1 parent ce4b34f commit 68b186f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions docker/alpine.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,19 @@ RUN PHP_CS_FIXER=$(jq -r '."'"${PHP_VERSION}"'".php_cs_fixer' < /tmp/php-flavour
&& chmod a+x /usr/bin/php-cs-fixer

# Install Node.js and pnpm (yarn and npm are included)
ENV PATH "$PATH:/usr/local/lib/nodejs/bin"
RUN if [ "0.0.0" = "$NODE_VERSION" ]; then exit 0; fi \
&& apk --no-cache add -U gcompat \
&& if [ "linux/arm64" = "$TARGET_PLATFORM" ]; \
then export DISTRO="linux-arm64"; \
else export DISTRO="linux-x64"; \
fi \
&& curl --silent --show-error --fail --location --output /tmp/node.tar.xz "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${DISTRO}.tar.xz" \
&& curl --silent --show-error --fail --location --output /tmp/node.tar.xz \
"https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${DISTRO}.tar.xz" \
&& mkdir -p /tmp/nodejs && tar -xJf /tmp/node.tar.xz -C /tmp/nodejs \
&& mv "/tmp/nodejs/node-v${NODE_VERSION}-${DISTRO}" /usr/local/lib/nodejs \
&& rm -rf /tmp/nodejs /tmp/node.tar.xz \
&& PATH="$PATH:/usr/local/lib/nodejs/bin" npm install -g yarn@latest pnpm@latest --force
ENV PATH "$PATH:/usr/local/lib/nodejs/bin"
&& npm install -g yarn@latest pnpm@latest --force

# --------------------------------
# Flashlight install and dump SQL
Expand Down
7 changes: 4 additions & 3 deletions docker/debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,18 @@ RUN PHP_CS_FIXER=$(jq -r '."'"${PHP_VERSION}"'".php_cs_fixer' < /tmp/php-flavour
&& chmod a+x /usr/bin/php-cs-fixer

# Install Node.js and pnpm (yarn and npm are included)
ENV PATH "$PATH:/usr/local/lib/nodejs/bin"
RUN if [ "0.0.0" = "$NODE_VERSION" ]; then exit 0; fi \
&& if [ "linux/arm64" = "$TARGET_PLATFORM" ]; \
then export DISTRO="linux-arm64"; \
else export DISTRO="linux-x64"; \
fi \
&& curl --silent --show-error --fail --location --output /tmp/node.tar.xz "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${DISTRO}.tar.xz" \
&& curl --silent --show-error --fail --location --output /tmp/node.tar.xz \
"https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-${DISTRO}.tar.xz" \
&& mkdir -p /tmp/nodejs && tar -xJf /tmp/node.tar.xz -C /tmp/nodejs \
&& mv "/tmp/nodejs/node-v${NODE_VERSION}-${DISTRO}" /usr/local/lib/nodejs \
&& rm -rf /tmp/nodejs /tmp/node.tar.xz \
&& PATH="$PATH:/usr/local/lib/nodejs/bin" npm install -g yarn@latest pnpm@latest --force
ENV PATH "$PATH:/usr/local/lib/nodejs/bin"
&& npm install -g yarn@latest pnpm@latest --force

# --------------------------------
# Flashlight install and dump SQL
Expand Down

0 comments on commit 68b186f

Please sign in to comment.