Public Repository

Last pushed: 6 months ago
Short Description
apache-php
Full Description

Apache PHP7

Voor web projects

Dockerfile:

FROM ubuntu

#Install dependencies

RUN apt-get update -y
RUN apt-get upgrade -y
RUN apt-get install -y git curl apache2 php libapache2-mod-php php-mcrypt php-mysql php-xml php-zip php-gd
RUN rm -f /etc/localtime
RUN ln -fs /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime

#Install app

RUN rm -rf /var/www/html/*
ADD src /var/www/html/
RUN rm -f /etc/apache2/sites-available/000-default.conf
ADD ./settings/000-default.conf /etc/apache2/sites-available/

#Configure apache

RUN a2enmod rewrite
RUN chown -R www-data:www-data /var/www/html/
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid

EXPOSE 80
COPY run.sh /run.sh
RUN chmod a+rx /run.sh
CMD ["/bin/bash", "/run.sh"]

run.sh file:

rm -f /var/run/apache2/apache2.pid
apachectl -DFOREGROUND

settings/000-default.conf file:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/


ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
<Files ~ "\.ini$">
Order allow,deny
Deny from all
</Files>
</VirtualHost>

Docker Pull Command
Owner
newdeveloper

Comments (0)