Public Repository

Last pushed: 4 months ago
Short Description
apache-php-composer
Full Description

Apache php7 composer

Voor projecten zoals laravel

Dockerfile:

FROM newdeveloper/apache-php

#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-mbstring php-xml php-gd php-zip php-curl php-tidy
RUN apt-get install -y vim nano
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
RUN chmod +x /usr/local/bin/composer

#Term aanmaken

RUN echo "export TERM=xterm" >> /root/.bashrc

#Install app

RUN rm -rf /var/www/html/*
ADD src /var/www/html/

#Configure apache

RUN rm -f /etc/apache2/sites-available/000-default.conf
ADD ./settings/000-default.conf /etc/apache2/sites-available/
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
ARG DEBIAN_FRONTEND=noninteractive
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/public/


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>
</VirtualHost>

Docker Pull Command
Owner
newdeveloper

Comments (0)