Install Wordpress using Docker Compose
This stack can be used to install Wordpress with a MySQL DB. Change the ports and volume binds as you need.
version: '2'
services:
db:
image: mysql:5.7
volumes:
- /wordpress/db:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
image: wordpress:latest
ports:
- 8977:80
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
- /home/usr/wordpress:/var/www/html
volumes:
db_data: