I'm running a Docker environment on Windows using the official WordPress image, and I've hit a couple of critical issues. After following the tutorial on the Docker site, I'm receiving error messages that say my site has performance and security problems.
Specifically, I'm encountering an error with the REST API that states it couldn't connect to the server on localhost at port 8080. This essentially means the connection failed when trying to access the REST API endpoint. Additionally, there's a problem with loopback requests, which are essential for running scheduled events and plugins. If these aren't working, my site's performance is extremely poor.
I've tried switching images, adjusting various configurations inside WordPress, and changing ports, but nothing has worked. Interestingly, if I switch to WAMP or XAMPP, those issues disappear, but I'd prefer to get it working with Docker. Any suggestions?
4 Answers
We could help more if we knew your Docker setup details. Sharing your config files would give better insight into what might be going wrong!
Just a heads up, running Docker on Windows can be a bit tricky since it's not a native environment. It uses virtualization, which can mess up networking. You might want to consider that while troubleshooting.
It sounds like you might not be opening the correct port. If you have a Docker Compose file or are using Docker commands, sharing that would help pinpoint any mistakes. Just a hunch, but this is likely the issue!
It seems like WordPress isn't able to locate itself properly. Check that the domain in the site URL is pointing to the correct host and that it can access the specified port. If you're behind a reverse proxy, you may need to ensure proper permissions and routing.

Definitely! The port settings are often overlooked, so checking those could solve the problem.