youPHPtube/app/Dockerfile

50 lines
2.0 KiB
Docker
Raw Normal View History

2022-02-20 18:03:58 +00:00
FROM php:7-apache
ENV DOMAIN localhost
ENV DOMAIN_PROTOCOL http
ENV SITE_TITLE AVideo
ENV ADMIN_PASSWORD password
ENV ADMIN_EMAIL webmaster@your.domain
ENV DB_HOST localhost
ENV DB_USER avideo
ENV DB_PASSWORD password
ENV DB_NAME avideo
ENV LANG en
ENV ENCODER https://encoder1.avideo.com/
ENV NFS_SERVER 192.168.1.45
ENV NFS_SHARE /mnt/biffa/youPHPtube
ENV PHP_MEMORY_LIMIT 2048M
ADD install.php /root/
ADD entrypoint.sh /usr/local/bin/
WORKDIR /var/www/html
RUN ln -snf /usr/share/zoneinfo/GMT /etc/localtime && echo 'Europe/London' > /etc/timezone \
&& apt-get update \
&& apt-get install apt-transport-https lsb-release logrotate git curl nano net-tools iputils-ping libzip-dev libpng-dev libjpeg-dev libfreetype6-dev libbz2-dev libxml2-dev libonig-dev libcurl4-openssl-dev ffmpeg -y --no-install-recommends \
&& docker-php-ext-configure gd --with-freetype=/usr/include --with-jpeg=/usr/include \
&& docker-php-ext-install -j$(nproc) bcmath xml mbstring curl mysqli gd zip \
&& rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* /root/.cache \
&& a2enmod rewrite \
&& echo "post_max_size = 10G\nupload_max_filesize = 10G" > $PHP_INI_DIR/conf.d/upload.ini \
&& echo "memory_limit = $PHP_MEMORY_LIMIT" > $PHP_INI_DIR/conf.d/memory.ini \
&& echo "max_execution_time = 72000" > $PHP_INI_DIR/conf.d/execution_time.ini \
&& service apache2 restart \
&& curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl \
&& chmod a+rx /usr/local/bin/youtube-dl \
&& git clone https://github.com/WWBN/AVideo.git \
&& mv AVideo/* . \
&& mv AVideo/.[!.]* . \
&& rm -rf AVideo \
&& chmod a+rx /usr/local/bin/entrypoint.sh \
&& mkdir videos \
# && apt-get install nfs-common \
# && echo "$NFS_SERVER:$NFS_SHARE /var/www/html/videos nfs rw,default 0 0" > /etc/fstab \
# && mount -t nfs $NFS_SERVER:$NFS_SHARE $WORKDIR/videos \
&& chmod 755 videos \
&& chown -R www-data:www-data /var/www/html
#COPY tw.php /var/www/html/locale/tw.php
VOLUME ["/var/www/html/videos"]
CMD ["entrypoint.sh"]