Run npm install as abc

This commit is contained in:
TheSpad 2023-05-13 16:49:18 +01:00
parent 8f26438325
commit 22af0e4de2
No known key found for this signature in database
GPG Key ID: 08F06191F4587860
3 changed files with 21 additions and 24 deletions

View File

@ -15,14 +15,13 @@ RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
nodejs \
npm \
openssl && \
npm && \
echo "**** install app ****" && \
mkdir -p \
/opt/mstream && \
if [ -z ${MSTREAM_RELEASE+x} ]; then \
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/mstream.tar.gz -L \
@ -31,15 +30,15 @@ RUN \
/tmp/mstream.tar.gz -C \
/opt/mstream/ --strip-components=1 && \
cd /opt/mstream && \
npm install --omit=dev && \
npm link && \
chown -R abc:abc ./ && \
su -s /bin/sh abc -c 'HOME=/tmp npm install --omit=dev' && \
echo "**** cleanup ****" && \
npm cache clean --force && \
rm -rf /opt/mstream/save/sync && \
rm -rf /config/.npm && \
ln -s /config/sync /opt/mstream/save/sync && \
rm -rf \
/tmp/*
$HOME/.cache \
/tmp/* \
/tmp/.npm
# add local files
COPY root/ /

View File

@ -15,14 +15,13 @@ RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
nodejs \
npm \
openssl && \
npm && \
echo "**** install app ****" && \
mkdir -p \
/opt/mstream && \
if [ -z ${MSTREAM_RELEASE+x} ]; then \
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/mstream.tar.gz -L \
@ -31,15 +30,15 @@ RUN \
/tmp/mstream.tar.gz -C \
/opt/mstream/ --strip-components=1 && \
cd /opt/mstream && \
npm install --omit=dev && \
npm link && \
chown -R abc:abc ./ && \
su -s /bin/sh abc -c 'HOME=/tmp npm install --omit=dev' && \
echo "**** cleanup ****" && \
npm cache clean --force && \
rm -rf /opt/mstream/save/sync && \
rm -rf /config/.npm && \
ln -s /config/sync /opt/mstream/save/sync && \
rm -rf \
/tmp/*
$HOME/.cache \
/tmp/* \
/tmp/.npm
# add local files
COPY root/ /

View File

@ -15,14 +15,13 @@ RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache --upgrade \
nodejs \
npm \
openssl && \
npm && \
echo "**** install app ****" && \
mkdir -p \
/opt/mstream && \
if [ -z ${MSTREAM_RELEASE+x} ]; then \
MSTREAM_RELEASE=$(curl -sX GET "https://api.github.com/repos/IrosTheBeggar/mStream/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/mstream.tar.gz -L \
@ -31,15 +30,15 @@ RUN \
/tmp/mstream.tar.gz -C \
/opt/mstream/ --strip-components=1 && \
cd /opt/mstream && \
npm install --omit=dev && \
npm link && \
chown -R abc:abc ./ && \
su -s /bin/sh abc -c 'HOME=/tmp npm install --omit=dev' && \
echo "**** cleanup ****" && \
npm cache clean --force && \
rm -rf /opt/mstream/save/sync && \
rm -rf /config/.npm && \
ln -s /config/sync /opt/mstream/save/sync && \
rm -rf \
/tmp/*
$HOME/.cache \
/tmp/* \
/tmp/.npm
# add local files
COPY root/ /