From 6a628e3357fa8e940327569977158df3f188cad3 Mon Sep 17 00:00:00 2001
From: Erick Hitter <git-contrib@ethitter.com>
Date: Sun, 12 Jun 2022 16:24:45 -0700
Subject: [PATCH] Add nvm for node management

Adding to the PHP images because certain WP-specific Grunt tasks rely on PHP,
so it makes sense to have it all in one place.

See also https://git.ethitter.com/gitlab/ci/wordpress/-/issues/1
---
 php/8.0/Dockerfile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/php/8.0/Dockerfile b/php/8.0/Dockerfile
index 827f649..a4f5f10 100644
--- a/php/8.0/Dockerfile
+++ b/php/8.0/Dockerfile
@@ -32,11 +32,15 @@ RUN docker-php-ext-install \
     && pecl install xdebug \
     && php -m
 
+ENV NVM_DIR /usr/local/nvm
+
 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
     && chmod +x /usr/local/bin/composer \
     && composer --version \
+    && mkdir $NVM_DIR \
     && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash \
+    && . $NVM_DIR/nvm.sh \
     && nvm --version
 
 ENV PATH=/root/.composer/vendor/bin:$HOME/.composer/vendor/bin:$PATH
-- 
GitLab