mysql -h myserver.mysql.database.azure.com -u adminuser@myserver -p
/* MySQL Commands */
/* drop database if exists wordpress; */
create user 'wordpress' IDENTIFIED BY "WP-Passw0rd";
create database wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress';
FLUSH PRIVILEGES;
WORDPRESS_DB_USER=wordpress@myserver
WORDPRESS_DB_PASSWORD=WP-Passw0rd
Optional with default values:
WORDPRESS_DB_HOST=westus1-a.control.database.windows.net
WORDPRESS_DB_NAME=wordpress
GIT_REPO=https://github.com/bartr/wordpressfiles.git
You should see the "famous WordPress 5 minute install" which will create a basic WordPress site automatically.
At this point, you should have a functioning WordPress site
Make sure ports 80 and 443 are open on your Docker host and no other services are using the ports
Note that WordPress embeds the FQDN into links, so you cannot reuse the database
Short Syntax (using defaults)
docker run -it -p 80:80 -p 443:443 --name wordpress \
-e WORDPRESS_DB_USER=wordpress@myserver \
-e WORDPRESS_DB_PASSWORD=WP-Passw0rd \
bartr/apache-wordpress
Full Syntax
docker run -it -p 80:80 -p 443:443 --name wordpress \
-e WORDPRESS_DB_USER=wordpress@myserver \
-e WORDPRESS_DB_PASSWORD=WP-Passw0rd \
-e WORDPRESS_DB_HOST=westus1-a.control.database.windows.net \
-e WORDPRESS_DB_NAME=wordpress \
-e GIT_REPO=https://github.com/bartr/wordpressfiles.git \
-e SSL_PEM='Your SSL Cert' \
-e SSL_KEY='Your SSL Key' \
bartr/apache-wordpress
If you want to explore the container, you can override the command with bash
docker run -it -p 80:80 -p 443:443 --name wordpress \
-e WORDPRESS_DB_USER=wordpress@myserver \
-e WORDPRESS_DB_PASSWORD=WP-Passw0rd \
bartr/apache-wordpress bash
You must run the git command to pull the WordPress files as they are not in the container
mkdir -p /home/www
git clone "$GIT_REPO" /home/www
Git the latest version (after running git clone)
git -C /home/www pull
WordPress files are located in /home/www/html
/usr/local/wprun.sh is the script that starts WordPress
Content type
Image
Digest
Size
134 MB
Last updated
over 8 years ago
docker pull antigravity/azurewp