Wordpress docker with empty responses to HTTP requests

I originally posted this on Stack Overflow but felt it would be better here.

I've got a Wordpress docker container that isn't really responding. Trying to access it from the browser results in an empty page. No 404 or anything. Trying curl from either a computer on the network, or the server itself returns an empty response as well.

I've done a docker exec -ti container bash into it to try and run curl from within, and it's also empty. /var/www/html is populated, and the single entry in /etc/apache2/sites-enabled is pointing to the /var/www/html directory.

There are no errors in /var/log/apache2/errors to speak of, which isn't helpful.

I've done the usual netstat -tlpn to verify that the server is listening on the correct port, and it is. I've also changed the addresses in the wp database to localhost, to see if that was causing the issue, but that didn't change anything.

Here's my docker-compose.yml, which is very simple

version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: PASSWORD
       MYSQL_DATABASE: DBNAME
       MYSQL_USER: USERNAME
       MYSQL_PASSWORD: PASSWORD

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     volumes:
       - ./upload.ini:/usr/local/etc/php/conf.d/uploads.ini
     ports:
       - 80:80
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:PORT
       WORDPRESS_DB_USER: USERNAME
       WORDPRESS_DB_PASSWORD: PASSWORD
       WORDPRESS_DB_NAME: DBNAME
volumes:
    db_data: {}

I'm at a loss as to what to check next, and am hoping to find ideas here.

Topic docker apache Wordpress

Category Web


I believe the answer was a messed up entry in either site_url or home within the MySQL database. I changed those settings and the issue was resolved.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.