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: 26
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: 19
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: 18
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: 20
  • 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: 21
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,950

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