Docker Setup for Local WordPress Development
ฝัง
- เผยแพร่เมื่อ 11 ก.ค. 2024
- Are you sick of working with complicated WordPress setups using tools like XAMPP? Or maybe you've got a not-quite-working Docker configuration and need just a nudge in the right direction?
In this video, I'm going to show you an way to set up a local WordPress development environment using Docker. We'll create a local NGINX image, along with a MySQL database, and bring everything together for WordPress.
It should make it easier to keep your own plugins and/or themes in version control, while ignoring the other bits of WordPress that you don't really care about.
👉👉Grab the Code on Github!
github.com/wazooinc/local-wor...
🔗Grab My Other Products Available:
- Build Your First Web Service API using Spring Boot 3: wazoowebbytes.gumroad.com/l/x...
👋🏻Connect with me:
Twitter: / eyuzwa
🔗References:
- Docker Desktop Client - www.docker.com/
- WordPress Download - wordpress.org/download/
📖I'm also going through the Bible over at @BibleTimeWithWazoo
===---=== Chapters ===---===
00:00 - Introduction
01:05 - Creating a .env
02:15 - Define Nginx in docker-compose.yml
04:30 - An nginx default.conf starter
07:48 - Define MySQL database in docker-compose.yml
11:00 - Define phpMyAdmin in docker-compose.yml
14:08 - Define WordPress in docker-compose.yml
18:20 - Update nginx default.conf for fastcgi
24:00 - Define local volume mirror for WordPress content
#wordpress #docker #nginx - วิทยาศาสตร์และเทคโนโลยี
Hope everyone finds some value in this one. I'm using it to try and follow up on comments left on a previous WordPress video of mine.
May I ask what's the difference between this and the previous video you made?
Great tutorial, thank you very much for this job
Thank you so much for leaving a comment and stopping by!
Truly good job!!!
booya! Thanks a lot, I truly appreciate it - thanks for stopping by!
Hello there! Nice video, can you please go this tutorial one step further to use custom domain like wordpress.test and SSL certificate?
Yes, sure! That's an excellent suggestion - appreciate that!
Hi! thanks for your tutorial, just tested this but ./src is created by the linux user, when WordPress on Docker is owned by www-data:www-data, how did you solved this?
This greatly good work. Can we move this environment to be live in azure devops environments
thank you so much. Yes, it should be possible to do that thanks to Docker. I don't have any Azure credits at the moment, but I'll keep that on my radar. Thanks for stopping by!
i cant log in to phpmyadmiin ((
Failed to set session cookie. Maybe you are using HTTP instead of HTTPS to access phpMyAdmin.
Perhaps that's why I can't install the WP -
Error establishing a database connection
Oh no!! Yes, in this first approach - there's no SSL support (yet), so it is just using HTTP. I released a followup video where I go through setting up some SSL. Hope that helps and good luck!
@@wazoowebbytes Thanks for the answer, I watched the next video, but as usual, there were even more problems )) -- I can't log in with the accesses that I registered in the .env file :
Cannot log in to the MySQL server
mysqli::real_connect(): (HY000/1045): Access denied for user 'dbuser'@'172.19.0.2' (using password: YES)
Didn't you have this problem during development?
everything worked, thanks for the content
oh nice! Glad you were able to get it working! What was the issue? (And no, I didn't have this specific problem during development)
Great tutorial, I learnt so much about docker composer setup.👍
Just one thing at 25:50, the mount is from the local machine to the containers. So you need to copy the content from the container to your local machine first before adding the "./src:/var/www/html/wp-content:rw".
hmm I'll experiment with that - thanks! I had to do something similar to a followup video I made on SSL, but I appreciate the feedback! Thanks a lot!
Nignx alway restart. is it i store container in wsl2 dir?
not that I know of. It should all be contained within Docker. I don't know what might be causing it to restart since this setup isn't watching for file changes..