docker-nginx-php-mysql icon indicating copy to clipboard operation
docker-nginx-php-mysql copied to clipboard

Add in WordPress

Open senrabdet opened this issue 6 years ago • 9 comments

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".

senrabdet avatar Mar 16 '18 12:03 senrabdet

That's a good idea to automated Wordpress installation. Send us a link when you got the project done.

nanoninja avatar Mar 19 '18 22:03 nanoninja

@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

zanematthew avatar Mar 28 '18 12:03 zanematthew

@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.

nanoninja avatar Mar 29 '18 11:03 nanoninja

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 avatar Mar 29 '18 12:03 zanematthew

@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.

nanoninja avatar Mar 29 '18 12:03 nanoninja

captura de pantalla de 2018-06-12 09-48-14

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

drm-code avatar Jun 12 '18 13:06 drm-code

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 avatar Jun 12 '18 14:06 drm-code

@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(); } ?>

al-mighty avatar Aug 19 '18 22:08 al-mighty

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 :)

ypinedaVS avatar Aug 20 '18 11:08 ypinedaVS