first of all you need to install docker and docker compose, you can find it in docker documentation and docker compose documentation
cd ~ && git clone https://github.com/sadeghmohebbi/dockerized-wordpress-nginx-php-mariadb.git
use your own password and envs in this file (mysql/Dockerfile)
use commands below in root directory. default provided docker compose file can be used
$ docker-compose up -d --build
to see what happens:
$ docker-compose logs -f
first of all give permission to php-fpm container to write file (avoiding permission issue) according to this stackoverflow question
$ docker exec -it PHP_CONTAINER_ID /bin/bash
inside nginx docker image use this commands:
$ mkdir /var/www/html/wp-content/plugins
$ mkdir /var/www/html/wp-content/uploads
$ chown -R www-data:www-data /var/www
$ find /var/www/ -type d -exec chmod 0755 {} ;
$ find /var/www/ -type f -exec chmod 644 {} ;
and then get worpress version you want from official website or simply use commands below:
$ cd ~ && wget https://wordpress.org/latest.tar.gz && tar -xvf latest.tar.gz
$ yes | cp -r wordpress/* dockerized-wordpress-nginx-php-mariadb/public_html
use mysql as a mysql host name and wordpress as a database name, other values are based on your configuration in mysql dockerfile (step 3)