

We're not going to customise the database container so we're ready to put it all together.and the rest

There's a lot going on in there however, the key points to know are, we're using the official PHP-Apache2 docker images as a base (found here), we also install some other packages needed for enabling some PHP extensions. RUN sed -ri -e 's!/var/# Enable mod_rewrite

RUN sed -ri -e 's!/var/www/html!$!g' /etc/apache2/sites-available/*.conf RUN docker-php-ext-install mysqli bcmath gd intl xml curl pdo_mysql pdo_sqlite hash zip dom session opcacheĮNV APACHE_DOCUMENT_ROOT /var/www/html/public RUN apt update & apt install -y apt-utils sendmail mariadb-client pngquant unzip zip libpng-dev libmcrypt-dev git \Ĭurl libicu-dev libxml2-dev libssl-dev libcurl3 libcurl3-dev libsqlite3-dev libsqlite3-0 # Run apt update and install some dependancies needed for docker-php-ext In your favourite editor open up docker/php-apache2/Dockerfile and paste in the following. This will create the following: docker-compose.ymlĭocker/php-apache2/Dockerfile The Web/PHP containerįirst up we'll get the web container configured as it's the only one we'll need a Dockerfile for. mkdir -p docker/php-apache2 & touch docker-compose.yml docker/php-apache2/Dockerfile In the root of your project we're going to want to create some files and folder structures, run the following command. I've generated an example project called mysite it's a typical composer based PHP site, with a public web root. We're going to build a local stack for development, so we're going to need Apache, PHP, and MariaDB database. I'm going to be doing this for an example Laravel site however this should work if you're using Drupal or some similar framework. I also assume you have installed docker and docker-compose locally. I'm going to assume you have some basic knowledge of docker.
