Sign inSign up

newdeveloper/apache-php

By newdeveloper

•Updated about 2 months ago

apache-php

Image
9

10M+

newdeveloper/apache-php repository overview

⁠Apache PHP8 ubuntu 2022-04

⁠Voor web projects

⁠Dockerfile:

FROM ubuntu

⁠#Install dependencies

RUN apt-get update -y RUN apt-get upgrade -y RUN apt-get install -y tzdata ENV TZ "Europe/Amsterdam" RUN echo "Europe/Amsterdam" > /etc/timezone
&& dpkg-reconfigure --frontend noninteractive tzdata RUN apt-get install -y git curl apache2 php libapache2-mod-php 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>                                                                                                                                                                  

Tag summary

Content type

Image

Digest

sha256:88fd416c5…

Size

146.6 MB

Last updated

about 2 months ago

docker pull newdeveloper/apache-php