Move nodemon install to the assemble script

This commit is contained in:
Honza Horak 2020-05-04 09:39:10 +02:00
commit 96ed5fa1b5
2 changed files with 12 additions and 7 deletions

View file

@ -48,6 +48,9 @@ LABEL summary="$SUMMARY" \
help="For more information visit https://github.com/sclorg/s2i-nodejs-container" \
usage="s2i build <SOURCE-REPOSITORY> centos/$NAME-$NODEJS_VERSION-centos7:latest <APP-NAME>"
# 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

View file

@ -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