Skip to content

sadeghmohebbi/dockerized-wordpress-nginx-php-mariadb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wordpress+nginx+php+mariadb with docker

1. install requirements

first of all you need to install docker and docker compose, you can find it in docker documentation and docker compose documentation

2. clone this repo

cd ~ && git clone https://github.com/sadeghmohebbi/dockerized-wordpress-nginx-php-mariadb.git

3. edit mariadb dockerfile file

use your own password and envs in this file (mysql/Dockerfile)

4. run it

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

5. install wordpress

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

6. last step

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)

About

dockerized wordpress nginx, php-fpm and mariaDB that really works

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published