diff --git a/README.md b/README.md index 4767a25e1098e55cd3f8255743a9110b913f1a0b..453dc71fb4ee32050ba24e098d8232f212f1a435 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 6768e7f658ef031af0e04f2d629f65568dfc52f7..857e05744a522906618b75d7c8ae297ba9a371c2 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} $@