Tutorial by Examples

In order to deploy the application on docker, first we need to get the image from registry. docker pull php This will get you the latest version of image from official php repository. Generally speaking, PHP is usually used to deploy web-applications so we need an http server to go with the imag...
Dockerfile is used to configure the custom image that we will be building with the web-application codes. Create a new file Dockerfile in the root folder of project and then put the following contents in the same FROM php:7.0-apache COPY /etc/php/php.ini /usr/local/etc/php/ COPY . /var/www/html/ ...
Building image is not something specific to php, but in order to build the image that we described above, we can simply use docker build -t <Image name> . Once the image is built, you can verify the same using docker images Which would list out all the images installed in your system. ...
Once we have an image ready, we can start and serve the same. In order to create a container from the image, use docker run -p 80:80 -d <Image name> In the command above -p 80:80 would forward port 80 of your server to port 80 of the container. The flag -d tells that the container should r...

Page 1 of 1