mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Docker: Reduce image layers and improve build scripts
This commit is contained in:
20
scripts/dist/install-nodejs.sh
vendored
Executable file
20
scripts/dist/install-nodejs.sh
vendored
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# abort if the user is not root
|
||||
if [[ $(id -u) != "0" ]]; then
|
||||
echo "Usage: run install-nodejs.sh as root" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
SETUP_URL="https://deb.nodesource.com/setup_16.x"
|
||||
|
||||
echo "Installing NodeJS and NPM from \"$SETUP_URL\"..."
|
||||
|
||||
curl -sL $SETUP_URL | bash -
|
||||
apt-get update && apt-get -qq install nodejs
|
||||
npm install --unsafe-perm=true --allow-root -g npm
|
||||
npm config set cache ~/.cache/npm
|
||||
|
||||
echo "Done."
|
||||
Reference in New Issue
Block a user