Skip to content

Commit

Permalink
Merge pull request #2 from inventaire/docker-npm
Browse files Browse the repository at this point in the history
added script to run npm installs
  • Loading branch information
jum-s committed Feb 20, 2020
2 parents 0ac4b35 + 6240439 commit 4769d46
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -22,6 +22,9 @@ clone the two repos inventaire needs to run :
```bash
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
```


Expand Down
13 changes: 13 additions & 0 deletions 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

0 comments on commit 4769d46

Please sign in to comment.