Browse Source

feat: environment variable arguments

master
Dnomd343 2 years ago
parent
commit
d283d875a3
  1. 2
      Dockerfile
  2. 24
      init.sh

2
Dockerfile

@ -36,7 +36,7 @@ COPY ./init.sh /release/usr/bin/alltube
COPY ./nginx/ /release/etc/nginx/
FROM ${ALPINE}
RUN apk add --no-cache nginx python3 php-fpm php-json php-mbstring \
RUN apk add --no-cache nginx ffmpeg python3 php-fpm php-json php-mbstring php-openssl \
php-dom php-gmp php-xml php-intl php-gettext php-simplexml php-tokenizer php-xmlwriter
COPY --from=build /release/ /
EXPOSE 80

24
init.sh

@ -1,7 +1,29 @@
#!/usr/bin/env sh
CONFIG="/var/www/alltube/config/config.yml"
sed -i "s,^audioBitrate:.*,audioBitrate: 320," "${CONFIG}"
sed -i "s,^youtubedl:.*,youtubedl: /usr/bin/yt-dlp," "${CONFIG}"
if [ -n "$TITLE" ]; then
sed -i "/^appName:/cappName: $TITLE" /var/www/alltube/config/config.yml
echo "Title: ${TITLE}"
sed -i "s,^appName:.*,appName: ${TITLE}," "${CONFIG}"
fi
if [ "$REMUX" = "TRUE" ] || [ "$REMUX" = "ON" ]; then
echo "Remux enabled"
sed -i "s,^remux:.*,remux: true," "${CONFIG}"
fi
if [ "$STREAM" = "TRUE" ] || [ "$STREAM" = "ON" ]; then
echo "Stream enabled"
sed -i "s,^stream:.*,stream: true," "${CONFIG}"
fi
if [ "$CONVERT" = "TRUE" ] || [ "$CONVERT" = "ON" ]; then
echo "Convert enabled"
sed -i "s,^convert:.*,convert: true," "${CONFIG}"
sed -i "s,^convertAdvanced:.*,convertAdvanced: true," "${CONFIG}"
fi
/usr/sbin/nginx

Loading…
Cancel
Save