The M
The M

Reputation: 661

Docker - WordPress - Localhost ERR_EMPTY_RESPONSE

I started working with Docker for WordPress. I followed the docker documentation to get it up and running:

https://docs.docker.com/compose/wordpress/

I added volumes for the plugin & theme directory.

When ran the command docker-compose up -d the first time and went to http://localhost:8000/ i saw the installation of WordPress. When i rebooted my PC and started the services again with: docker-compose up -d or docker-compose start i got the error message: ERR_EMPTY_RESPONSE.

I tried:

Currently I have no idea why it isn't working anymore. I am working on macOS

This is my current docker-compose.yml

version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: somewordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     volumes:
      - ./plugins/my-plugin:/var/www/html/wp-content/plugins/my-plugin
      - ./themes/my-theme:/var/www/html/wp-content/themes/my-theme
     ports:
       - "8000:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: wordpres
volumes:
    db_data: {}

The status of containers after running it: enter image description here

enter image description here

Upvotes: 0

Views: 2155

Answers (1)

Valerian Pereira
Valerian Pereira

Reputation: 727

Follow these steps

  1. docker-compose down - twice
  2. Edit the yml file and replace all instances of db_data with db_datax
  3. Run docker-compose up -d

Alternately,

  1. docker-compose down - twice {removes the network as well}
  2. docker system prune --volumes
  3. docker-compose up -d

Upvotes: 2

Related Questions