docker-nginx-php-mysql
docker-nginx-php-mysql copied to clipboard
Add in WordPress
Great post/repository, fantastic instructions. Am hoping to request adding Wordpress into the mix as a docker container if that's of interest to others (am trying, initially am getting port conflicts and suspect that is the tip of the iceberg). Thx for giving it "a think".
That's a good idea to automated Wordpress installation. Send us a link when you got the project done.
@senrabdet @nanoninja wouldn't this be outside of the scope of the project? Adding WordPress is as easy as adding your WP code to web/
directory.
I'm currently using this with a Laravel project, and wouldn't expect this to be specific to a particular open source platform.
@senrabdet also its WordPress
@senrabdet, @zanematthew,
No indeed I do not think add it to this project either but I realize that what often changes is the organization depending on the type of project as (Laravel, Symfony, Wordpress).
I was thinking about developing a CLI tool based on project creation and that could be adapted to different types of applications more easily with less configuration. (Like Yeoman)
I'll see that when I have some time.
One idea might be to have a command that generates the web/ contents dynamically based on project; just quickly thinking here;
user enters a command, command prompts user for archive of web root (be it wordpress core.zip) process unpacks the contents (or downloads from remote URL) prompts user for nginx config etc... and can dynamically build the contents of the web root, without having the source files in the repo.
@zanematthew,
Yes I think it's a good idea for the future. This will make it more flexible and less dependent on the particular application type.
it would be a good evolution to put in place.
I'm getting this error when I try to install a wordpress.
I copied wordpress code to /web
directory, installation starts well but when I configure the mysql data it fails, it seems like mysql is not running but phpmyadmin works like charm.
Any ideas??
I tried localhost
localhost:8989
localhost:3306
After multiple tries, I did docker inspect mysql
which returns a huge json, then I looked for NetworkSettings.Networks.docker-nginx-php-mysql_default.IPAddress
key and set that IP in wordpress settings page, voala!!! it works try that if you have the same issue.
@drm-code работает с hostname mysql try
<?php try { $dsn = 'mysql:host=mysql;dbname=broadcastdemo;charset=utf8;port=3306'; $pdo = new PDO($dsn, 'root', 'root'); foreach($pdo->query('SELECT * from wpkv_users') as $row) { print_r($row); } var_dump(json_encode($pdo)); } catch (PDOException $e) { echo $e->getMessage(); } ?>
Hi @devVyacheslav thanks for your answer, what I noticed is that everytime you run the container which wrappers the wordpress mysql IP changes not randomly but could change for example 198.128.0.3 to 198.128.0.4 and maybe 198.128.0.5 and it keeps some kind of pattern, what I just did everytime is test an IP from a set of them :)