1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Oinktube/Dockerfile
Daniel Neto b3f30f1575 Update
2023-02-21 12:21:14 -03:00

104 lines
4.2 KiB
Docker

FROM ubuntu/apache2:2.4-22.10_edge
LABEL maintainer="TRW <trw@acoby.de>" \
org.label-schema.schema-version="1.0" \
org.label-schema.version="1.1.0" \
org.label-schema.name="avideo-platform" \
org.label-schema.description="Audio Video Platform" \
org.label-schema.url="https://github.com/WWBN/AVideo" \
org.label-schema.vendor="WWBN"
ARG DEBIAN_FRONTEND=noninteractive
ARG SOCKET_PORT
ARG HTTP_PORT
ARG HTTPS_PORT
ARG NGINX_RTMP_PORT
ARG NGINX_HTTP_PORT
ARG NGINX_HTTPS_PORT
ARG DB_MYSQL_HOST
ARG DB_MYSQL_PORT
ARG DB_MYSQL_NAME
ARG DB_MYSQL_USER
ARG DB_MYSQL_PASSWORD
ARG SERVER_NAME
ARG CREATE_TLS_CERTIFICATE
ARG TLS_CERTIFICATE_FILE
ARG TLS_CERTIFICATE_KEY
ARG CONTACT_EMAIL
ARG SYSTEM_ADMIN_PASSWORD
ARG WEBSITE_TITLE
ARG MAIN_LANGUAGE
# Retrieve package list
RUN apt update
# Install dependencies
RUN apt-get update -y && apt-get upgrade -y \
&& apt install -y --no-install-recommends dos2unix bash-completion lsof cron rsync ca-certificates apt-transport-https software-properties-common curl \
&& curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp \
&& chmod a+rx /usr/local/bin/yt-dlp \
&& apt install -y --no-install-recommends sshpass nano net-tools curl apache2 php8.1 libapache2-mod-php8.1 php8.1-mysql php8.1-sqlite3 php8.1-curl php8.1-gd php8.1-intl \
php-zip mysql-client ffmpeg git libimage-exiftool-perl libapache2-mod-xsendfile python3-certbot-apache -y && a2enmod xsendfile && cd /var/www/html \
&& apt install -y --no-install-recommends && curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl \
&& chmod a+rx /usr/local/bin/youtube-dl && apt install -y --no-install-recommends build-essential libpcre3 libpcre3-dev libssl-dev php8.1-xml -y \
&& a2enmod rewrite \
&& apt install -y --no-install-recommends unzip -y && apt install -y --no-install-recommends htop python3-pip \
&& pip3 install youtube-dl && pip3 install --upgrade youtube-dl && a2enmod expires \
&& a2enmod headers
COPY deploy/apache/avideo.conf /etc/apache2/sites-enabled/000-default.conf
COPY deploy/docker-entrypoint /usr/local/bin/docker-entrypoint
COPY deploy/wait-for-db.php /usr/local/bin/wait-for-db.php
# Install nginx
RUN apt-get install build-essential libssl-dev libpcre3 libpcre3-dev wget -y \
&& apt-get install --reinstall zlib1g zlib1g-dev -y \
&& mkdir /var/www/tmp && chmod -R 777 /var/www/tmp \
&& mkdir /HLS && mkdir /HLS/live && chmod -R 777 /HLS
RUN mkdir ~/build \
&& cd ~/build \
&& git clone https://github.com/arut/nginx-rtmp-module.git \
&& git clone https://github.com/nginx/nginx.git \
&& cd nginx \
&& ./auto/configure --with-http_ssl_module --with-http_stub_status_module --add-module=../nginx-rtmp-module --with-cc-opt="-Wimplicit-fallthrough=0" \
&& make \
&& make install\
&& cd /usr/local/nginx/html && wget https://youphp.tube/docs/stat.xsl
COPY deploy/nginx/nginx.conf /usr/local/nginx/conf/nginx.conf
COPY deploy/crontab /etc/cron.d/crontab
RUN chmod 0644 /etc/cron.d/crontab
# Configure AVideo
RUN dos2unix /usr/local/bin/docker-entrypoint && \
chmod 755 /usr/local/bin/docker-entrypoint && \
chmod +x /usr/local/bin/docker-entrypoint && \
pip3 install youtube-dl && \
sed -i 's/^post_max_size.*$/post_max_size = 10G/' /etc/php/8.1/apache2/php.ini && \
sed -i 's/^upload_max_filesize.*$/upload_max_filesize = 10G/' /etc/php/8.1/apache2/php.ini && \
sed -i 's/^max_execution_time.*$/max_execution_time = 7200/' /etc/php/8.1/apache2/php.ini && \
sed -i 's/^memory_limit.*$/memory_limit = 512M/' /etc/php/8.1/apache2/php.ini && \
a2enmod rewrite expires headers ssl xsendfile
# Add Apache configuration
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
VOLUME /var/www/tmp
RUN mkdir -p /var/www/tmp && \
chown www-data:www-data /var/www/tmp && \
chmod 777 /var/www/tmp
WORKDIR /var/www/html/AVideo/
EXPOSE $SOCKET_PORT
EXPOSE $HTTP_PORT
EXPOSE $HTTPS_PORT
EXPOSE $NGINX_RTMP_PORT
EXPOSE $NGINX_HTTPS_PORT
ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]
CMD ["apache2-foreground"]
HEALTHCHECK --interval=60s --timeout=55s --start-period=1s CMD curl --fail https://localhost/ || exit 1