From c85ae5b8f9f761e2bb60895c3e5c60718a6f45e6 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Sat, 11 Jan 2020 13:16:56 +0100
Subject: [PATCH] Set default of the used node version to 12-stretch-slim

---
 README.md    | 9 +++++++++
 bin/node_cmd | 5 ++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 4767a25..453dc71 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,15 @@ Register a runner with GitLab Runner and configure it like this:
     [runners.cache.gcs]
 ```
 
+# Node version
+
+When using node from within this framework, this defaults to version `12-stretch-slim` but you can change the default version by setting the environment variable `NODE_VERSION` to one of these tags:
+
+- 8-jessie-slim
+- 10-jessie-slim
+- 12-stretch-slim
+- 13-stretch-slim
+
 # Credit
 
 - [Image from jonaskello](https://github.com/jonaskello/docker-and-compose)
diff --git a/bin/node_cmd b/bin/node_cmd
index 6768e7f..857e057 100755
--- a/bin/node_cmd
+++ b/bin/node_cmd
@@ -1,5 +1,8 @@
 #!/bin/bash
 
+if [[ -z "$NODE_VERSION" ]]; then
+  NODE_VERSION=12-stretch-slim
+fi
 NAME=${COMPOSE_PROJECT_NAME}_l3d_node
 ID=$(docker container ls --all -q -f name=^${NAME}$)
 if [[ -n ${ID} ]]; then
@@ -19,6 +22,6 @@ else
     --env COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME} \
     -v $(php /usr/local/bin/volume.php) \
     -w ${PWD} \
-    registry.lakedrops.com/docker/node:8-jessie-slim >/dev/null
+    registry.lakedrops.com/docker/node:${NODE_VERSION} >/dev/null
 fi
 docker exec -it -w ${PWD} ${NAME} ${NODE_CMD} $@
-- 
GitLab