This repository has been archived on 2021-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
Dockerfiles/peertube/rootfs/usr/local/bin/startup

31 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
#addgroup --gid ${GID} peertube && adduser --disabled-password --shell /bin/sh --gid ${GID} --uid ${UID} --gecos "" peertube
groupadd -g ${GID} peertube && useradd -u ${UID} -M -g ${GID} peertube
cd /PeerTube
sed -i -e 's|<https>|'${HTTPS}'|' \
-e 's|<hostname>|'${HOSTNAME}'|' \
-e 's|<port>|'${PORT}'|' \
-e 's|<database_host>|'${DATABASE_HOST}'|' \
-e 's|<database_port>|'${DATABASE_PORT}'|' \
-e 's|<database_username>|'${DATABASE_USERNAME}'|' \
-e 's|<database_password>|'${DATABASE_PASSWORD}'|' \
-e 's|<admin_email>|'${ADMIN_EMAIL}'|' \
-e 's|<signup_enabled>|'${SIGNUP_ENABLE}'|' \
-e 's|<transcoding_enable>|'${TRANSCODING_ENABLE}'|' \
-e 's|<transcoding_threads>|'${TRANSCODING_THREADS}'|' /PeerTube/config/production.yaml
sed -i -e 's|<body_size>|'${BODY_SIZE}'|' /etc/nginx/sites-enabled/peertube.conf
chown -R $UID:$GID ./
#npm start
if [ $# -eq 0 ]; then
su - peertube -c "NODE_ENV=production npm start"
else
su - peertube -c "NODE_ENV=production npm $#"
fi