diff options
| author | Mhd Sulhan <ms@kilabit.info> | 2015-11-20 15:10:01 +0700 |
|---|---|---|
| committer | Mhd Sulhan <ms@kilabit.info> | 2015-11-20 15:10:01 +0700 |
| commit | b25939b6c8b1c15f56628ebcb927c339a766f1b1 (patch) | |
| tree | 5a0b8259f02e948c77a193d5c1bf7ac757580eb1 | |
| parent | 298ea2d47835509be5458c1486e9d19e81c6ee75 (diff) | |
| download | arch-docker-b25939b6c8b1c15f56628ebcb927c339a766f1b1.tar.xz | |
Add build script for nodejs with sailsjs.
| -rwxr-xr-x | arch-base-sailsjs/bootstrap_sailsjs.sh | 9 | ||||
| l--------- | arch-base-sailsjs/clean.sh | 1 | ||||
| l--------- | arch-base-sailsjs/create_image.sh | 1 | ||||
| l--------- | arch-base-sailsjs/create_rootfs.sh | 1 | ||||
| -rwxr-xr-x | arch-base-sailsjs/init.sh | 12 | ||||
| -rwxr-xr-x | arch-base-sailsjs/run.sh | 3 | ||||
| -rwxr-xr-x | arch-base-sailsjs/vars.sh | 19 |
7 files changed, 46 insertions, 0 deletions
diff --git a/arch-base-sailsjs/bootstrap_sailsjs.sh b/arch-base-sailsjs/bootstrap_sailsjs.sh new file mode 100755 index 0000000..eb9041b --- /dev/null +++ b/arch-base-sailsjs/bootstrap_sailsjs.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +npm install -g sails --unsafe-perm && \ + npm install -g pm2 --unsafe-perm && \ + npm install -g grunt && \ + rm -r /root/.node-gyp + +## cleaning ... +bootstrap_clean_nodejs diff --git a/arch-base-sailsjs/clean.sh b/arch-base-sailsjs/clean.sh new file mode 120000 index 0000000..1e93f10 --- /dev/null +++ b/arch-base-sailsjs/clean.sh @@ -0,0 +1 @@ +../scripts/clean.sh
\ No newline at end of file diff --git a/arch-base-sailsjs/create_image.sh b/arch-base-sailsjs/create_image.sh new file mode 120000 index 0000000..ec69652 --- /dev/null +++ b/arch-base-sailsjs/create_image.sh @@ -0,0 +1 @@ +../scripts/create_image.sh
\ No newline at end of file diff --git a/arch-base-sailsjs/create_rootfs.sh b/arch-base-sailsjs/create_rootfs.sh new file mode 120000 index 0000000..54a9807 --- /dev/null +++ b/arch-base-sailsjs/create_rootfs.sh @@ -0,0 +1 @@ +../scripts/create_rootfs.sh
\ No newline at end of file diff --git a/arch-base-sailsjs/init.sh b/arch-base-sailsjs/init.sh new file mode 100755 index 0000000..fa99c69 --- /dev/null +++ b/arch-base-sailsjs/init.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +#COMMANDS="pm2 start app.js" +WORKDIR=${WORKDIR:-"/srv/www"} +COMMANDS=${COMMANDS:-"pm2 --no-daemon start app.js"} +NODE_ENV=${NODE_ENV:-"production"} + +cd $WORKDIR + +npm install + +eval $COMMANDS diff --git a/arch-base-sailsjs/run.sh b/arch-base-sailsjs/run.sh new file mode 100755 index 0000000..25c0f97 --- /dev/null +++ b/arch-base-sailsjs/run.sh @@ -0,0 +1,3 @@ +#!/bin/zsh + +docker run --env-file=env --net=host --rm -v $PWD/src:/srv/www -it sulhan/arch-nodejs-sails diff --git a/arch-base-sailsjs/vars.sh b/arch-base-sailsjs/vars.sh new file mode 100755 index 0000000..1394230 --- /dev/null +++ b/arch-base-sailsjs/vars.sh @@ -0,0 +1,19 @@ +#!/bin/zsh + +THISD=${0:a:h} + +ROOTFS_SIZE=900M + +PKGS+=(util-linux) +PKGS_ADD+=(git gcc make python2 nodejs npm) +PKGS_REMOVED=() + +IMAGE_NAME="sulhan/arch-nodejs-sails" +IMAGE_ARGS=(-c="VOLUME /srv/www" -c="EXPOSE 80" -c="CMD /init.sh") +IMAGE_FILES_BAK+=("${ROOTFS}/root/.npm" "${THISD}/npm") + +FILES+=("${THISD}/init.sh" "${ROOTFS}/") +FILES+=("${THISD}/bootstrap_sailsjs.sh" "${ROOTFS}/") +FILES+=("${THISD}/npm" "${ROOTFS}/root/.npm") + +BOOTSTRAP_S+=("/bootstrap_sailsjs.sh") |
