Add Dockerfile.
This commit is contained in:
36
Dockerfile
Normal file
36
Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
FROM php:5.6-apache
|
||||||
|
|
||||||
|
RUN apt-get -y update && \
|
||||||
|
apt-get -y upgrade
|
||||||
|
|
||||||
|
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
|
||||||
|
|
||||||
|
RUN chmod +x /usr/local/bin/install-php-extensions && \
|
||||||
|
install-php-extensions gd mysqli pdo_mysql && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
|
||||||
|
|
||||||
|
ENV APACHE_DOCUMENT_ROOT /var/www/html
|
||||||
|
|
||||||
|
RUN sed -ri -e 's!/var/www/html!/var/www/html!g' /etc/apache2/sites-available/*.conf
|
||||||
|
RUN sed -ri -e 's!/var/www/!/var/www/html!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
|
||||||
|
RUN sed -ri -e 's!AllowOverride None!AllowOverride All!g' /etc/apache2/apache2.conf
|
||||||
|
|
||||||
|
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
||||||
|
RUN sed -ri -e 's!upload_max_filesize = 2M!upload_max_filesize = 8M!g' $PHP_INI_DIR/php.ini
|
||||||
|
|
||||||
|
RUN a2enmod rewrite
|
||||||
|
|
||||||
|
ARG UNAME=www-data
|
||||||
|
ARG UGROUP=www-data
|
||||||
|
ARG UID=1000
|
||||||
|
ARG GID=1000
|
||||||
|
|
||||||
|
RUN usermod --uid $UID $UNAME
|
||||||
|
RUN groupmod --gid $GID $UGROUP
|
||||||
|
|
||||||
|
WORKDIR ${APACHE_DOCUMENT_ROOT}
|
||||||
|
|
||||||
|
COPY . ${APACHE_DOCUMENT_ROOT}
|
||||||
|
|
||||||
|
VOLUME ${APACHE_DOCUMENT_ROOT}
|
||||||
Reference in New Issue
Block a user