diff --git a/Dockerfile b/Dockerfile index 300f78c..2718b0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,6 +48,9 @@ LABEL summary="$SUMMARY" \ help="For more information visit https://github.com/sclorg/s2i-nodejs-container" \ usage="s2i build centos/$NAME-$NODEJS_VERSION-centos7:latest " +# TODO: Add nodejs-nodemon into Fedora +# https://bugzilla.redhat.com/show_bug.cgi?id=1433784 +# meanwhile install it during s2i assemble step RUN yum -y module enable nodejs:$NODEJS_VERSION && \ INSTALL_PKGS="nodejs npm nss_wrapper" && \ yum remove $INSTALL_PKGS -y && \ @@ -55,13 +58,6 @@ RUN yum -y module enable nodejs:$NODEJS_VERSION && \ rpm -V $INSTALL_PKGS && \ yum -y clean all --enablerepo='*' -# TODO: Add nodejs-nodemon into Fedora -# https://bugzilla.redhat.com/show_bug.cgi?id=1433784 -#RUN NPM_CONFIG_PREFIX=$HOME/../ npm install -g nodemon && \ -# rm $(npm config get cache)/* -rf && \ -# rm -rf $(npm config get tmp)/npm-* - - # Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH COPY ./s2i/bin/ $STI_SCRIPTS_PATH diff --git a/s2i/bin/assemble b/s2i/bin/assemble index 78c9b97..97af35e 100755 --- a/s2i/bin/assemble +++ b/s2i/bin/assemble @@ -68,6 +68,15 @@ if [ -z "$DEV_MODE" ]; then export DEV_MODE=false fi +# TODO: Add nodejs-nodemon into Fedora +# https://bugzilla.redhat.com/show_bug.cgi?id=1433784 +# meanwhile install it during s2i assemble step +if [ "$(source /etc/os-release ; echo $NAME)" == "Fedora" ] ; then + NPM_CONFIG_PREFIX=$HOME/../ npm install -g nodemon && \ + rm $(npm config get cache)/* -rf && \ + rm -rf $(npm config get tmp)/npm-* +fi + # If NODE_ENV is not set by the user, then NODE_ENV is determined by whether # the container is run in development mode. if [ -z "$NODE_ENV" ]; then