Wordpress in Docker

Currently reading
Wordpress in Docker

I went through the logs and did a screen shot to jpg of the possible port error.... if this is so... I need to find an appropriate port #. I took the port # from the link page... hmmmm
 

Attachments

  • Port Problem?.jpg
    Port Problem?.jpg
    177.1 KB · Views: 25
WordPress cannot start because the MariaDB container where the WordPress database resides has stopped. Like you described a couple of posts back. So you need to get the logs of that container to see what happened to it.
 
Last edited:
No problem!

I'm using docker-compose and probably confused you with it. Sorry about that.

I now see you probably followed this excellent guide here and use the Synology Docker GUI.

Because of the error message you get (see PDF), I think you probably did not set the correct environment variables on the wordpress and wordpressdb containers.

From step #5 in the tutorial
Code:
MYSQL_DATABASE: name_your_database
MYSQL_ROOT_PASSWORD: choose_root_password
MYSQL_USER: your_user_name
MYSQL_PASSWORD: choose_user_password

Here you setup the WordPress database and user. You also specify a password for the root user (the administrator user for MariaDB).

MariaDB is a community-developed, commercially supported fork of the MySQL. That is why you see the MySQL prefixes...

Example
Code:
MYSQL_DATABASE: blog_db
MYSQL_ROOT_PASSWORD: root123
MYSQL_USER: wpuser
MYSQL_PASSWORD: wpuser123

From step #10
Code:
WORDPRESS_DB_HOST: the_container_name_for_your_DB (from step #1)
WORDPRESS_DB_NAME: name_of_your_database (from step #5)
WORDPRESS_DB_USER: user_name (from step #5)
WORDPRESS_DB_PASSWORD: user_password (from step #5)

Here you instruct WordPress to connect to the WordPress database that you setup earlier. With the same credentials from earlier: database name, user and password.

Example
Code:
WORDPRESS_DB_HOST: wordpressdb
WORDPRESS_DB_NAME: blogdb
WORDPRESS_DB_USER: wpuser
WORDPRESS_DB_PASSWORD: wpuser123

Then restart your containers.
 
I went in this morning and set up what was suggested above.... that said I appear to be missing applying my root password somewhere as when I turn on the container the db starts and then quits with the log saying (below photo):
 

Attachments

  • Screen Shot 2021-06-05 at 9.43.37 AM.png
    Screen Shot 2021-06-05 at 9.43.37 AM.png
    200.5 KB · Views: 16
Last edited:
For the love of Pete! Thanks. I'll go see what happens!
-- post merged: --

Well the did work! Thank you. Now just one more glitch. When I ...In General Settings, set up a Web Page shortcut for the desktop by using the local port #, I get an Error message saying "Error in making a Database connection"........ Should the Local Port number be the same as the Container Port number?
 
Last edited:
Not sure what you mean? You should now be able to access WordPress by pointing your browser to http://ip-address-nas:32789.

Edit:
Host and container port do not have to be the same. On the left you see the host port. On the right the container port. Do not change the container port.

Edit 2:
...and your WORDPRESS_DB_HOST should be wordpressdb and not wordpress.
 
Can't access via the ......:32789 . The local port in the Wordpress is 32789 The local port in the wordpressdb is "auto"
 

Attachments

  • Screen Shot 2021-06-05 at 2.19.58 PM.png
    Screen Shot 2021-06-05 at 2.19.58 PM.png
    104.7 KB · Views: 17
You shouldn't use auto. Set it to a port that is free and you like to use like e.g. 8080.

For example 8080:80 means port 8080 on the host maps to port 80 in the container and you can access the container through http://ip-address-nas:8080.

And you have the wrong WORDPRESS_DB_HOST setting. It should be wordpressdb and not wordpress. That is why the database connection fails.
 
I believe I am more confused than not. I did the WORD_DB_HOST setting change. I tried to change to local port at 8080 but it says I can't use as 8080 is already in use. So as you can tell I am a feck-all novice.. below is currently the two screen shots of the wordpress ports settings and the wordpressdb ports settings
Thanks for your patience
 

Attachments

  • Screen Shot 2021-06-05 at 4.13.18 PM.png
    Screen Shot 2021-06-05 at 4.13.18 PM.png
    61.1 KB · Views: 19
  • Screen Shot 2021-06-05 at 4.13.00 PM.png
    Screen Shot 2021-06-05 at 4.13.00 PM.png
    74.3 KB · Views: 18
Maybe it is best if you check the guide once more? :D

From the guide:

#3. Maria - Port Settings
Since we will be using names, you can leave this tab as Auto.

So this will look like Auto:3306.

#8. Wordpress - Port Settings
Since you will want to be able to access your Wordpress site from the web, you will need to specify a port to connect to port 80 on the container.

If port 8080 is already in use you can use another port like 8888.

So this will look like 8888:80.

WordPress will be available on http://ip-address-nas:8888.
 
Can't thank you enough for you perseverance with my limited patchwork knowledge. It actually works! I am chipping away at the mountain. Now I will start learning up on moving my travel blog over. I had it in google blog when i was traveling, then recently moved it to WP on the NAS. I thought it better to learn how to use Docker before I invest in putting time into 3rd party programs on the NAS. Docker seems to be what makes more sense. Again thanks for your guidance.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

Replies
4
Views
1,021
Wordpress has been working, then yesterday I noticed updates, did these above and now I can't get to the...
Replies
0
Views
1,286
I just decided to have www.mydomain.com as canonical domain name. The need of having a redirect, is that...
Replies
54
Views
12,360
Hi Akira, I tried to follow your directions the best I could but probably I failed because it does not...
Replies
8
Views
6,044
Just notice Synology is offering to upgrade WordPress to Gutenberg (>5.0). That's what I have been long...
Replies
0
Views
12,786
<body> yes this what I mean. WordPress doesn't have such sophistic css/formating for 'code' , only...
Replies
6
Views
2,739
If the image supports... Even so, it can't be authenticated with a LAN IP.
Replies
3
Views
1,207

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top