In the previous long lecture, I have prepared the all commands that I will use to start those three
containers.
And first of all, let's create a new custom network using First command.
This one Docker network, create WordPress.
Let me copy it.
I'll use Ctrl, C, Ctrl v.
No need to enter all commands manually and let's create a new network here.
Network was created, let's inspect it, Docker network, inspect WordPress and here we subnet that
will be used for containers in this custom WordPress network.
Great.
Let's proceed and let's take next command.
This one that will start MySQL server.
Let me copy it.
Go to terminal paste it.
Here is ID of container that will be running MySQL 5.7.
Let's go back to VS code.
Let's take next command that will start WordPress.
Let me copy it.
Go back to terminal.
Paste.
Here is of WordPress container.
And finally, let's start phpMyAdmin container.
Copy this command.
Go to terminal and paste it here.
Enter.
And here I see id of phpMyAdmin container.
Let's verify whether all containers are now running Docker PS and yes, I see those three containers
and you see here port mapping for phpMyAdmin container.
Its name custom name phpMyAdmin.
Also you see port mapping for WordPress container.
And here you see custom name for WordPress container and custom name for MySQL container as well.
Notice that we don't need to have any port mapping for MySQL container because WordPress and phpMyAdmin
container will communicate with MySQL container internally in the internal custom WordPress network.
There is no need to expose MySQL database to external world.
Great.
Let's now verify connectivity to WordPress.
Let's go to Google Chrome.
I don't need those steps anymore.
And here let's remove this part.
And now recap that WordPress is running at port 8080 and phpMyAdmin is running at port 8081.
Great.
Let's press enter now and here I see.
Welcome page for WordPress Initial configuration dialog.
Let's select language.
It is English.
Click continue.
And now I'm prompted to enter database name, username, password and host.
Let's go.
Database name WordPress Recap that we have set up all those parameters here in this section in those
environment variables, WordPress everywhere.
So let's enter those parameters here.
WordPress is database name, WordPress is username and password is also WordPress.
Here I don't need to use root password, I'll use username and password for specific database wordpress
and database host.
You may guess will be MySQL.
It's a name of container that is running MySQL.
Great.
Let's fingers crossed and let's press submit.
And I see error establishing a database connection.
Sorry, guys.
I failed at my first attempt.
Let me find out what is the reason for this error.
Let me first try to go to terminal and let me have a look at the logs of MySQL server.
Let me have a look at them using MySQL.
Name of the container.
Let me clear terminal.
Docker logs MySQL.
And here you see access denied for user WordPress at.
And here is address seems to me address of WordPress container.
All right, let me go to vs code and verify username here.
WordPress WordPress database.
WordPress.
It seems all is good.
Let me go to MySQL Docker Hub Web page.
This one.
And check whether I have correctly entered all environment variables.
Let me scroll down a bit.
All right.
Environment variables.
So MySQL database, MySQL user and MySQL password.
It seems I have entered MySQL username instead of user.
Yeah, sorry for that guys.
So here must be user and it will be equal to wordpress.
Great.
Let me save this configuration and let me go back to terminal.
Clear it.
And now I need to stop and remove MySQL container and then run it over again.
So Docker PS Docker stop MySQL.
Docker rm MySQL.
I need to remove it because I'll reuse its name MySQL.
Otherwise I'll get duplicate name error.
So removed.
And now let me go back to this command.
Copy it.
Run MySQL container.
Go back to terminal paste here.
All right, here is the ID of this container.
Now let's go back to WordPress web page and try to initialize connection to MySQL server again.
So localhost 88 English.
Let's continue.
And now let's again enter database name, username, password and host.
Let's go.
Database name is wordpress.
Let me copy it.
Username is the same as database name.
WordPress.
Password is also WordPress and database host is MySQL like this.
And let's submit.
Yeah.
Now it works.
Sorry for this error, guys.
Actually, I was able to rerecord those videos, but actually I wanted to leave it here in place and
sorry again.
It's my fault and it happens.
Yeah.
Okay.
Let's run installation.
And here I see welcome page where I'm able to add site title username of administrator.
Here is password of administrator and here you need to enter any email.
All right, let's add the site title and I'll use Welcome to bogdan's.
Wonderful website username will be Bogdan password will be same as here.
Let me copy it by the way.
And also let's add the email and I could use my personal email.
You could use any fake email here.
If you don't plan to publish this website somewhere in public.
Anyway, I'll use my personal email.
If you have something to write me, please do so it's my personal email, so let's install WordPress.
And process was successful.
Let me save this password here.
And actually I need to turn on sync.
I will do that now.
I have actually password copied into clipboard.
Let me log in here.
Username Lockdown password.
Let me copy it.
Here it is.
And let's check checkbox.
Remember me and login.
And I was successfully logged into WordPress dashboard and here you see WordPress admin and I'm actually
able to open up front end web page by going to this address.
And yes, I see.
Welcome to Bogdan's Wonderful website web page.
Great.
Finally, I was able to launch a WordPress with MySQL and phpMyAdmin.
By the way, let me verify connection to phpmyadmin localhost.
8081.
And here will be username.
Let's say WordPress and password will be also WordPress Go.
And I was successfully logged to MySQL server and I could list databases here and now I have actually
access only to WordPress database.
If you want to log in as root user, you are also able to do so by using root as username and my password
as password.
Here we have specified this password as well.
Here it is.
Great.
That's all for this challenge.
And again, sorry for my small error.
I have fixed it.
And actually that's all for this section where we have tried to create multiple containers in the custom
network.
I'll see you guys next.
And next, let's try another image, for example.
Elasticsearch Image.
I'll see you next.
Bye bye.