Skip to content

Instantly share code, notes, and snippets.

@aawaheed
Last active October 20, 2016 20:54
Show Gist options
  • Save aawaheed/b1147d1c50016b906e17cbfdf191e658 to your computer and use it in GitHub Desktop.
Save aawaheed/b1147d1c50016b906e17cbfdf191e658 to your computer and use it in GitHub Desktop.
Commands to run wordpress docker
version: '2'
services:
wordpress:
image: wordpress:4.6.1-apache
ports:
- 8080:80
volumes:
- ./wp-content:/var/www/html/wp-content
links:
- mysql
environment:
WORDPRESS_DB_PASSWORD: wp
mysql:
image: mariadb:10.1.18
ports:
- 3306:3306
volumes:
- ./mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: wp

To install MariaDB which is open-source fork of mysql.

The docker image can be found at Docker Hub: mariadb

The command to run the docker is

docker run --name coolmysql -e MYSQL_ROOT_PASSWORD=wp -d -p 8081:3306 mariadb:10.1.18

To install wordpress. The docker image can be found at Docker Hub: wordpress

The command to run the docker is

docker run --name coolwordpress --link coolmysql:mysql -e WORDPRESS_DB_PASSWORD=wp -d -p 8080:80  wordpress:4.6.1-apache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment