How to deploy a WordPress Docker container using docker-compose
These are the steps to setup the current website in a Docker container. The setup uses docker-compose to declaratively describe a two-container application: a MySQL 5.5 database and a WordPress frontend. Docker links tie them together so that the web container can reach the database by hostname, without needing to hard-code any IP addresses or manage networking manually. A single docker-compose up command downloads the required images and starts both containers, with port 80 on the host forwarded into the WordPress container.
|
|
Then create a file fig.yml which contains:
|
|
This description takes advantage of a Docker feature to bind together two or more containers: Docker links. We use it to make the WordPress container depends on another container with MySQL 5.5.
The `docker-compose up` command will read `fig.yml`, download the needed data and deploy the two containers.
|
|
Et voilà, the port 80 of the host which runs the container will be forwarded to the port 80 of the WordPress container.