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 KiB
Plaintext
Raw Normal View History

2017-06-29 14:54:47 +02:00
#!/bin/sh
2017-11-03 10:13:35 +01:00
#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
2017-06-29 14:54:47 +02:00
sed -i -e 's|<https>|'${HTTPS}'|' \
-e 's|<hostname>|'${HOSTNAME}'|' \
2017-06-29 16:44:49 +02:00
-e 's|<port>|'${PORT}'|' \
2017-06-29 14:54:47 +02:00
-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}'|' \
2017-06-29 16:59:37 +02:00
-e 's|<signup_enabled>|'${SIGNUP_ENABLE}'|' \
2017-06-29 14:54:47 +02:00
-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
2017-06-29 14:54:47 +02:00
chown -R $UID:$GID ./
#npm start
2017-06-29 14:54:47 +02:00
if [ $# -eq 0 ]; then
su - peertube -c "NODE_ENV=production npm start"
2017-06-29 14:54:47 +02:00
else
su - peertube -c "NODE_ENV=production npm $#"
2017-11-03 10:13:35 +01:00
fi