A Docker image based on Ubuntu, running PHP7 on Apache2 using a MySQL Database for a Symfony2 Web Application.
The host machine must have Docker installed in order to build and run the Container. Instructions on how to install Docker can be found on the official page
Docker Compose helps on orchestrating the communication between the application
container and mysql
container.
Instructions on how to install Docker Compose can be found on the official page.
On the host machine clone the GitHub(git
is required to be installed) repository by executing:
git clone https://github.com/redjanym/docker-apache-php7-mysql-symfony2.git
On the application directory setup the Symfony2 App. Do not install the Vendor packages, composer takes care of it during the building process.
Go to the root directory of project and execute command:
docker-compose up
hosts
file on he host machine by adding the virtual host:127.0.0.1 www.example.com
The docker installation exposes ports 80 and 3306 so this 2 ports must be free on the host machine