File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,13 @@ FROM php:7.1-apache-stretch
2
2
3
3
ARG DEBIAN_FRONTEND=noninteractive
4
4
5
+ # Install NVM and the current (as of 26/02/2019) LTS version of Node.
6
+ ENV NVM_DIR /usr/local/nvm
7
+ ENV NODE_VERSION lts/carbon
8
+ RUN mkdir -p $NVM_DIR && \
9
+ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash && \
10
+ . $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use --delete-prefix $NODE_VERSION
11
+
5
12
# Install the standard PHP extensions.
6
13
ADD root/tmp/setup/php-extensions.sh /tmp/setup/
7
14
RUN chmod 777 /tmp && chmod +t /tmp && \
Original file line number Diff line number Diff line change @@ -9,6 +9,15 @@ mkdir /var/www/phpunitdata && chown www-data:www-data /var/www/phpunitdata
9
9
mkdir /var/www/behatdata && chown www-data:www-data /var/www/behatdata
10
10
mkdir /var/www/behatfaildumps && chown www-data:www-data /var/www/behatfaildumps
11
11
12
+ # Ensure that all users get NVM as standard.
13
+ echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> /etc/bash.bashrc
14
+ echo ' export NODE_REPL_HISTORY=' >> /etc/bash.bashrc
15
+ mkdir /var/www/.config && chown www-data:www-data /var/www/.config
16
+
17
+ # Ensure that the requested version of node is installed.
18
+ source $NVM_DIR /nvm.sh && nvm install $NODE_VERSION && nvm use --delete-prefix $NODE_VERSION
19
+ echo ' nvm use "$NODE_VERSION"' >> /etc/bash.bashrc
20
+
12
21
# Load any additional entrypoint init files.
13
22
for f in /docker-entrypoint-initdb.d/* ; do
14
23
case " $f " in
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -Eeo pipefail
3
+
4
+ # This is a wrapper around NVM to load the nvm functions, and then run nvm.
5
+
6
+ if [ -z " $( LC_ALL=C type -t nvm) " ] || [ " $( LC_ALL=C type -t nvm) " != function ]
7
+ then
8
+ # The `nvm` variable does not exist, or is not a function.
9
+ # Source nvm.sh to load it.
10
+ [ -s " $NVM_DIR /nvm.sh" ] && . " $NVM_DIR /nvm.sh"
11
+ fi
12
+
13
+ nvm $@
You can’t perform that action at this time.
0 commit comments