Docker; Wordpress

Hoe een Wordpress site installeren onder docker?

docker run -e WORDPRESS_DB_USER=XXX -e WORDPRESS_DB_PASSWORD=YYY -e WORDPRESS_DB_NAME=ZZZ -p LSTPRT:80 -v PATT:/var/www/html --link DBSRV:mysql --net NETT --ip IPP --name CONTA-d wordpress

YYY= SQL Password
ZZZ= DB Name
LSTPRT= Listenport for the container
PATT= Path for your conatiner content
NETT= Your network name
IPP= IP-adress for the server
DBSRV= Database Server name (fe container)
CONTA= Name of your container

Following an example to install a wordpress instance with teh name walle on the sql server baloo:

docker run -e WORDPRESS_DB_USER=root -e WORDPRESS_DB_PASSWORD=SQLPASS -e WORDPRESS_DB_NAME=walle -p 17600:80 -v /var/docker/walle:/var/www/html --link baloo:mysql --net DMZContainers --ip --name walle -d wordpress

Be carefull with the listener port! This must be the same for the wordpress site. Later on, I’ll explain the exact setup to be able to have a wordpress internal as external reachable…