diff options
| author | Mhd Sulhan <ms@kilabit.info> | 2015-09-15 00:56:13 +0700 |
|---|---|---|
| committer | Mhd Sulhan <ms@kilabit.info> | 2015-09-15 00:56:13 +0700 |
| commit | e9e4a1a7f3618e2fc636dcc3b9e1c6d1f5788cdb (patch) | |
| tree | c5e7df80e1c3f5c5cd627621e20d5b0bb03d4897 /arch-nodejs/init.sh | |
| parent | 45f80367326abbdac2b9575620e96024b9bde57d (diff) | |
| download | arch-docker-e9e4a1a7f3618e2fc636dcc3b9e1c6d1f5788cdb.tar.xz | |
Various fixes and updates.
## news
- init.sh: script to run if no command given.
- run.sh: sample script to run the image.
## Dockerfile.local,Dockerfile.online
- Set volume.
- Reorder command to optimize using image caches.
- Use init.sh as start command.
## bootstrap.sh
Always sync when running pacman. This is to prevent error 404 when
downloading package because the file has been removed on server.
## build.sh
Merge copy commands into single command.
Diffstat (limited to 'arch-nodejs/init.sh')
| -rwxr-xr-x | arch-nodejs/init.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch-nodejs/init.sh b/arch-nodejs/init.sh new file mode 100755 index 0000000..24c520f --- /dev/null +++ b/arch-nodejs/init.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +export WORKDIR=${WORKDIR:-"/srv/www"} +export COMMANDS=${COMMANDS:-"npm start"} +export NODE_ENV=${NODE_ENV:-"development"} + +cd $WORKDIR + +if [ ! -d $WORKDIR/node_modules ]; then + npm install +fi + +eval $COMMANDS |
