Skip to content

Commit

Permalink
Docker configuration, mk. 2
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAssassin committed Apr 30, 2018
1 parent 806bc92 commit 1860760
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit 1860760

Please sign in to comment.