diff --git a/README.md b/README.md index f14c030..33adccd 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,9 @@ clone the two repos inventaire needs to run : ``` git clone https://github.com/inventaire/inventaire.git git clone https://github.com/inventaire/entities-search-engine.git +# Install NodeJS dependencies +./scripts/docker_npm inventaire install +./scripts/docker_npm entities-search-engine install ``` Create empty folders for docker volume to dump backup. In accordance with docker-compose volumes, example: `mkdir data couch-test couch es` diff --git a/scripts/docker_npm b/scripts/docker_npm new file mode 100644 index 0000000..676a826 --- /dev/null +++ b/scripts/docker_npm @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -eu + +path=$1 +cwd=$(realpath $path) +dir=$(dirname $cwd) +workdir="/opt/${dir}" +uid=$(stat -c '%u' $cwd) + +# All args but the first one +npm_args="${@:2}" + +docker run --user $uid --rm --volume "${cwd}:/${workdir}" --workdir $workdir node:8 npm --color=always $npm_args