Sign inSign up

n0bility6/apache2-php

By n0bility6

Updated over 3 years ago

ubuntu:20.04 with apache2, php and composer for lumen application

Image
0

131

n0bility6/apache2-php repository overview

Dockerfile

FROM ubuntu:20.04
MAINTAINER [email protected]

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update && apt-get install git php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath apache2 -y

WORKDIR /var/www/html

RUN rm -rf /var/www/html/*
RUN unlink /etc/apache2/sites-enabled/000-default.conf
RUN rm /etc/apache2/sites-available/000-default.conf
COPY 000-default.conf /etc/apache2/sites-available
RUN ln -s /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-enabled/000-default.conf
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
    && php composer-setup.php --install-dir /usr/local/bin --filename=composer \
    && php -r "unlink('composer-setup.php');" 

EXPOSE 80
CMD /etc/init.d/php7.4-fpm restart && apachectl -D FOREGROUN

000-default.conf

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/lumen/public

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

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

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Changes

v2-----------------------------
- Adjust FPM php.ini post_max_size and upload_max_filesize to 50M.
- Install Ghostscript and nano.

Tag summary

Content type

Image

Digest

sha256:52c1bbd80

Size

160.2 MB

Last updated

over 3 years ago

docker pull n0bility6/apache2-php:v2.0