Docker Wordpress timeout limit error db connection

admin

Administrator
Staff member
For the first time I'm using Docker on Digital Ocean for a Wordpress installation. The setup is ok, also the theme installation, but when I install the Revolution Slider plugin the server show me: "Error establishing a database connection".

Plugin installed successfully.

<strong>Warning</strong>: mysqli_query(): MySQL server has gone away in /var/www/html/wp-includes/wp-db.php on line 1877

<strong>Warning</strong>: mysqli_query(): Error reading result set's header in /var/www/html/wp-includes/wp-db.php on line 1877

IMAGE COMMAND CREATED <strong>STATUS</strong><br>
mysql:latest "docker-entrypoint..." About an hour ago <strong>Restarting (1) 12 minutes ago</strong>

I restarted all the container, Wordpress works but I can't see any Plugin and the Theme page show me only "ERROR: The theme directory themename does not exist", but looking the FTP the directory is there. Any suggestion? Thanks!

docker-compose.yml

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override">
Code:
version: '2'
services:
  digitalpmi:
    container_name: digitalpmi_wp
    depends_on:
      - db
    image: wordpress:latest
    restart: always
    volumes:
      - ./wp-content:/var/www/html/wp-content
    environment:
    - VIRTUAL_HOST=[ip]
    - WORDPRESS_DB_NAME=dpdb
    - WORDPRESS_TABLE_PREFIX=dp_
    - WORDPRESS_DB_HOST=db
    - WORDPRESS_DB_PASSWORD=[password]
    networks:
      - front
      - back
  db:
    container_name: digitalpmi_db
    image: mysql:latest
    restart: always
    volumes:
       - db_data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD:[password]
    networks:
      - back
  phpmyadmin:
    container_name: phpmyadmin
    depends_on:
      - db
    image: phpmyadmin/phpmyadmin
    restart: always
    ports:
      - 8181:80
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD:[password]
    networks:
      - back
  nginx-proxy:
    image: jwilder/nginx-proxy
    container_name: nginx-proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
    networks:
      - front
networks:
  front:
  back:
volumes:
  db_data:
</div>
</div>