diff options
| author | Mhd Sulhan <ms@kilabit.info> | 2015-11-20 01:57:59 +0700 |
|---|---|---|
| committer | Mhd Sulhan <ms@kilabit.info> | 2015-11-20 01:57:59 +0700 |
| commit | f88d9cb8ef13b748415bd5688d7fd0a144eb8a6b (patch) | |
| tree | 185fe086e8aadf99eee200c0deaafc0b76bb417d | |
| parent | 7ef69d6cfeddc7ad0f6fc03b923269b5b5307557 (diff) | |
| download | arch-docker-f88d9cb8ef13b748415bd5688d7fd0a144eb8a6b.tar.xz | |
Add build script for nodejs image.
| -rwxr-xr-x | arch-base-nodejs/bootstrap_nodejs.sh | 11 | ||||
| l--------- | arch-base-nodejs/clean.sh | 1 | ||||
| l--------- | arch-base-nodejs/create_image.sh | 1 | ||||
| l--------- | arch-base-nodejs/create_rootfs.sh | 1 | ||||
| -rwxr-xr-x | arch-base-nodejs/init.sh | 13 | ||||
| l--------- | arch-base-nodejs/src | 1 | ||||
| -rwxr-xr-x | arch-base-nodejs/vars.sh | 17 |
7 files changed, 45 insertions, 0 deletions
diff --git a/arch-base-nodejs/bootstrap_nodejs.sh b/arch-base-nodejs/bootstrap_nodejs.sh new file mode 100755 index 0000000..313a4cb --- /dev/null +++ b/arch-base-nodejs/bootstrap_nodejs.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "==> bootstraping nodejs ..." + +## cleaning ... +rm -r /usr/share/icu/* +rm -r /usr/lib/node_modules/npm/doc/* +rm -r /usr/lib/node_modules/npm/html/doc/* +rm -r /usr/lib/node_modules/npm/man/* +rm -rf /usr/lib/python2.7/test +rm -rf /usr/share/perl5 diff --git a/arch-base-nodejs/clean.sh b/arch-base-nodejs/clean.sh new file mode 120000 index 0000000..1e93f10 --- /dev/null +++ b/arch-base-nodejs/clean.sh @@ -0,0 +1 @@ +../scripts/clean.sh
\ No newline at end of file diff --git a/arch-base-nodejs/create_image.sh b/arch-base-nodejs/create_image.sh new file mode 120000 index 0000000..ec69652 --- /dev/null +++ b/arch-base-nodejs/create_image.sh @@ -0,0 +1 @@ +../scripts/create_image.sh
\ No newline at end of file diff --git a/arch-base-nodejs/create_rootfs.sh b/arch-base-nodejs/create_rootfs.sh new file mode 120000 index 0000000..54a9807 --- /dev/null +++ b/arch-base-nodejs/create_rootfs.sh @@ -0,0 +1 @@ +../scripts/create_rootfs.sh
\ No newline at end of file diff --git a/arch-base-nodejs/init.sh b/arch-base-nodejs/init.sh new file mode 100755 index 0000000..a9ab876 --- /dev/null +++ b/arch-base-nodejs/init.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +export WORKDIR=${WORKDIR:-"/srv/www"} +export COMMANDS=${COMMANDS:-"npm start"} +export NODE_ENV=${NODE_ENV:-"production"} + +cd $WORKDIR + +if [ ! -d $WORKDIR/node_modules ]; then + npm install +fi + +eval $COMMANDS diff --git a/arch-base-nodejs/src b/arch-base-nodejs/src new file mode 120000 index 0000000..0c7f095 --- /dev/null +++ b/arch-base-nodejs/src @@ -0,0 +1 @@ +../../myabuy/proofn/src/sails-on-docker-test
\ No newline at end of file diff --git a/arch-base-nodejs/vars.sh b/arch-base-nodejs/vars.sh new file mode 100755 index 0000000..712a639 --- /dev/null +++ b/arch-base-nodejs/vars.sh @@ -0,0 +1,17 @@ +#!/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" +IMAGE_ARGS=(-c="VOLUME /srv/www" -c="EXPOSE 80" -c="CMD /init.sh") + +FILES+=("${THISD}/init.sh" "${ROOTFS}/") +FILES+=("${THISD}/bootstrap_nodejs.sh" "${ROOTFS}/") + +BOOTSTRAP_S+=("/bootstrap_nodejs.sh") |
