php-pear php7.4 php7.4-cgi php7.4-cli php7.4-phpdbg php7.4-fpm php7.4-dev php7.4-common php7.4-curl php7.4-gd php7.4-imap php7.4-intl php7.4-ldap php7.4-mysql php7.4-pgsql php7.4-pspell php7.4-recode php7.4-snmp php7.4-sqlite3 php7.4-sybase php7.4-tidy php7.4-opcache php7.4-json php7.4-bz2 php7.4-mcrypt php7.4-odbc php7.4-readline php7.4-interbase php7.4-xmlrpc php7.4-enchant php7.4-gmp php7.4-xsl php7.4-bcmath php7.4-mbstring php7.4-soap php7.4-xml php7.4-zip php7.4-dba php7.4-amqp php7.4-apcu php7.4-geoip php7.4-igbinary php7.4-imagick php7.4-mongodb php7.4-msgpack php7.4-oauth php7.4-redis php7.4-rrd php7.4-smbclient php7.4-solr php7.4-ssh2 php7.4-zmq php7.4-radius php7.4-http php7.4-uploadprogress php7.4-xdebug php7.4-memcached php7.4-memcache php7.4-mailparse php7.4-propro php7.4-raphf php7.4-stomp php7.4-gearman php7.4-mongo php7.4-xhprof
version: "3.7"
services:
php7_app:
container_name: php7_app
image: 'rohmanahmad/php7.4-apache-full'
ports:
- '8080:80'
volumes:
- ./src:/var/www/html
If you want to customize your own image, feel free to edit your Dockerfile and add this code
FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
USER root
# Install Utilities
RUN apt-get update --fix-missing
RUN apt-get install -y curl unzip build-essential nano wget mcrypt
RUN apt-get -qq update && apt-get -qq -y install bzip2
RUN apt-get install -y chrpath libssl-dev libxft-dev
RUN apt-get install -y libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
# Install ppa:ondrej/php PPA
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:ondrej/php
RUN apt-get update --fix-missing
RUN apt-get install -y libapache2-mod-php7.4 libphp7.4-embed php-pear php7.4 php7.4-cgi php7.4-cli php7.4-phpdbg php7.4-fpm php7.4-dev php7.4-common php7.4-curl php7.4-gd php7.4-imap php7.4-intl php7.4-ldap php7.4-mysql php7.4-pgsql php7.4-pspell php7.4-snmp php7.4-sqlite3 php7.4-sybase php7.4-tidy php7.4-opcache php7.4-json php7.4-bz2 php7.4-mcrypt php7.4-odbc php7.4-readline php7.4-interbase php7.4-xmlrpc php7.4-enchant php7.4-gmp php7.4-xsl php7.4-bcmath php7.4-mbstring php7.4-soap php7.4-xml php7.4-zip php7.4-dba php7.4-amqp php7.4-apcu php7.4-geoip php7.4-igbinary php7.4-imagick php7.4-mongodb php7.4-msgpack php7.4-oauth php7.4-redis php7.4-rrd php7.4-smbclient php7.4-solr php7.4-ssh2 php7.4-zmq php7.4-radius php7.4-http php7.4-uploadprogress php7.4-xdebug php7.4-memcached php7.4-memcache php7.4-mailparse php7.4-propro php7.4-raphf php7.4-stomp php7.4-gearman php7.4-mongo php7.4-xhprof
RUN apt-get install -y apache2 libapache2-mod-fcgid composer supervisor
COPY ./config/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
COPY ./config/supervisor/conf.d /etc/supervisor/conf.d
COPY ./config/apache/vhost.conf /etc/apache2/sites-available/000-default.conf
# COPY ./config/mods-available/xdebug.ini /etc/php/7.4/mods-available/xdebug.ini
# COPY ./config/mods-available/mongodb.ini /etc/php/7.4/mods-available/mongodb.ini
# PHP Config
# Show PHP 7.4 errors on development server.
RUN sed -i -e 's/^error_reporting\s*=.*/error_reporting = E_ALL/' /etc/php/7.4/apache2/php.ini
RUN sed -i -e 's/^display_errors\s*=.*/display_errors = On/' /etc/php/7.4/apache2/php.ini
RUN sed -i -e 's/^zlib.output_compression\s*=.*/zlib.output_compression = Off/' /etc/php/7.4/apache2/php.ini
RUN sed -i -e 's/^zpost_max_size\s*=.*/post_max_size = 32M/' /etc/php/7.4/apache2/php.ini
RUN sed -i -e 's/^upload_max_filesize\s*=.*/upload_max_filesize = 32M/' /etc/php/7.4/apache2/php.ini
RUN mkdir -p /tmp/logs/apache /tmp/logs/xdebug /tmp/logs/common
RUN mkdir /run/php
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
RUN a2enmod rewrite actions fcgid alias proxy_fcgi setenvif ssl proxy proxy_balancer proxy_http
RUN a2enconf php7.4-fpm
EXPOSE 80
CMD ["supervisord","-n", "-c", "/etc/supervisor/supervisord.conf"]
apache.conf
[program:apache]
command=apachectl -DFOREGROUND
autostart=true
autorestart=true
priority=2
startretries=1
startsecs=1
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
fpm.conf
[program:php-fpm]
command = php-fpm7.4 -R -F -c /etc/php/7.4/fpm/php-fpm.conf
autostart=true
autorestart=true
priority=1
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
<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
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php/php7.4-fpm.sock|fcgi://localhost:9000/"
</FilesMatch>
# 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 /tmp/apache-logs/error.log
CustomLog /tmp/apache-logs/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
Content type
Image
Digest
sha256:90bf63eb4…
Size
292.7 MB
Last updated
over 2 years ago
docker pull rohmanahmad/php7.4-apache-full