diff --git a/latest/Dockerfile b/latest/Dockerfile index 22fe251..62d5c29 100644 --- a/latest/Dockerfile +++ b/latest/Dockerfile @@ -12,6 +12,7 @@ RUN apk -U upgrade \ && git checkout ${HASTEBIN_VERSION} \ && npm install \ && npm cache clean --force \ + && mkdir /.npm \ && apk del git \ && rm -rf /var/lib/apk/* /var/cache/apk/* \ && chmod +x /usr/local/bin/run.sh diff --git a/latest/run.sh b/latest/run.sh index d5b4567..01f1c03 100644 --- a/latest/run.sh +++ b/latest/run.sh @@ -5,4 +5,6 @@ set -xe # we have to run the chown here since the VOLUME is mounted # after the build with root:root chown -R ${UID}:${GID} /app +chown -R ${UID}:${GID} /.npm + su-exec ${UID}:${GID} npm start diff --git a/stable/Dockerfile b/stable/Dockerfile index 22fe251..62d5c29 100644 --- a/stable/Dockerfile +++ b/stable/Dockerfile @@ -12,6 +12,7 @@ RUN apk -U upgrade \ && git checkout ${HASTEBIN_VERSION} \ && npm install \ && npm cache clean --force \ + && mkdir /.npm \ && apk del git \ && rm -rf /var/lib/apk/* /var/cache/apk/* \ && chmod +x /usr/local/bin/run.sh diff --git a/stable/run.sh b/stable/run.sh index d5b4567..01f1c03 100644 --- a/stable/run.sh +++ b/stable/run.sh @@ -5,4 +5,6 @@ set -xe # we have to run the chown here since the VOLUME is mounted # after the build with root:root chown -R ${UID}:${GID} /app +chown -R ${UID}:${GID} /.npm + su-exec ${UID}:${GID} npm start