Hi@akhtar,
You can download wordpress image from docker hub. WordPress is a free and open source blogging tool and a content management system (CMS) based on PHP and MySQL database. So in back end wordpress requires MySQL as well. You can use the below given code to implement your task.
version: '3.1'
services:
wordpress:
image: wordpress
restart: always
ports:
- 8080:80
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: exampleuser
WORDPRESS_DB_PASSWORD: examplepass
WORDPRESS_DB_NAME: exampledb
volumes:
- wordpress:/var/www/html
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: exampledb
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepass
MYSQL_RANDOM_ROOT_PASSWORD: '1'
volumes:
- db:/var/lib/mysql
volumes:
wordpress:
db:
Write this code a docker-compose.yml file and run that file using the below given command.
$ docker-compose up