forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
806bc92
commit 1860760
Showing
1 changed file
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,22 +3,34 @@ | |
# Licensed under the terms of the CC-0 license, see | ||
# https://creativecommons.org/publicdomain/zero/1.0/deed | ||
|
||
FROM ubuntu:xenial | ||
FROM php:7-apache | ||
|
||
MAINTAINER TheAssassin <[email protected]> | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y apache2 php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-curl php7.0-gd php7.0-intl ffmpeg libimage-exiftool-perl python git curl python-pip \ | ||
&& rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* /root/.cache \ | ||
&& a2enmod rewrite | ||
RUN apt-get update && \ | ||
apt-get install -y wget git zip default-libmysqlclient-dev libbz2-dev libmemcached-dev libsasl2-dev libfreetype6-dev libicu-dev libjpeg-dev libmemcachedutil2 libpng-dev libxml2-dev mariadb-client ffmpeg libimage-exiftool-perl python curl python-pip && \ | ||
docker-php-ext-configure gd --with-freetype-dir=/usr/include --with-jpeg-dir=/usr/include && \ | ||
docker-php-ext-install -j$(nproc) bcmath bz2 calendar exif gd gettext iconv intl mbstring mysqli opcache pdo_mysql zip && \ | ||
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* /root/.cache && \ | ||
a2enmod rewrite | ||
|
||
RUN pip install -U youtube-dl | ||
# patch to use non-root port | ||
RUN sed -i "s|Listen 80|Listen 8000|g" /etc/apache2/ports.conf && \ | ||
sed -i "s|:80|:8000|g" /etc/apache2/sites-available/* && \ | ||
echo "post_max_size = 10240M\nupload_max_filesize = 10240M" >> /usr/local/etc/php/php.ini | ||
|
||
WORKDIR /var/www/html | ||
RUN pip install -U youtube-dl | ||
|
||
RUN rm -rf /var/www/html/* | ||
COPY . /var/www/html | ||
|
||
ADD docker/000-default.conf /etc/apache2/sites-enabled/000-default.conf | ||
# fix permissions | ||
RUN chown -R www-data. /var/www/html | ||
|
||
# create volume | ||
RUN install -d -m 0755 -o www-data -g www-data /var/www/html/videos | ||
|
||
# set non-root user | ||
USER www-data | ||
|
||
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] | ||
VOLUME ["/var/www/html/videos"] |