Docker is extremely slow on Windows 11

Viewed 28

I try to run a local copy of a WordPress site using docker-compose, apache, mysql and phpmyadmin. But the local site loads very slow. It takes at least 100+ seconds to load/refresh a page. WSL 2 is enabled.

I also tried to run another WP website locally but the result is still the same.

Here's my docker-compose file:

version: "3.9"

services:
  db:
    image: mysql:8
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: 1234
      MYSQL_DATABASE: wordpress
      MYSQL_USER: test
      MYSQL_PASSWORD: 1234
    ports:
      - "3306:3306"

  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    volumes:
      - ./:/var/www/html
    ports:
      - "8000:80"
    restart: always
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: test
      WORDPRESS_DB_PASSWORD: 1234
      WORDPRESS_DB_NAME: wordpress

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: pma_wp
    restart: always
    ports:
      - "8082:80"
    environment:
      PMA_HOST: db
      PMA_PORT: 3306
      UPLOAD_LIMIT: 8000M
      MEMORY_LIMIT: 8000M
      MAX_EXECUTION_TIME: 60000
      MYSQL_ROOT_PASSWORD: 1234
    links:
      - db:db

volumes:
  db_data:

The UPLOAD_LIMIT, MEMORY_LIMIT and MAX_EXECUTION_TIME were set to such values because I had to import a huge db dump.

0 Answers
Related