Docker Community Forums

Share and learn in the Docker community.

Docker images and compose on external SSD for WordPress not working

docker

#1

Hi. I’m attempting to have Docker run WordPress installations on an external drive. It’s a 1TB Samsung T5 SSD formatted to exFAT. I would like to be able to use this across Windows and Mac OS

I changed the disk image location to the external drive which worked fine. The problems come when running docker-compose up on the external drive. It’s extremely slow to build the images. I had to extend the timeout period as it kept throwing errors. It now gets to a point where WordPress can’t connect to MySQL, returning the error ‘Connection refused’.

I left it trying to connect for about an hour at one point and came back to see the WordPress installation screen. So maybe it’s just a speed issue, but I’m not sure why this might be the case.

Everything works fine when I have the image on the main drive of the Mac and run docker-compose, it’s only when it’s moved to the external SSD.

Here is my Docker-compose.yml file:

version: "3.3"

services:
  # Database
  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
      MYSQL_ROOT_PASSWORD: password
    networks:
      - wpsite
  # phpmyadmin
  phpmyadmin:
    depends_on:
      - db
    image: phpmyadmin/phpmyadmin
    restart: always
    ports:
      - "8181:80"
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: password
    networks:
      - wpsite
  # Mailcatcher
  mailcatcher:
    image: schickling/mailcatcher
    ports:
      - "1025:1025"
      - "1080:1080"
    environment:
      MAILCATCHER_PORT: 1025
  # Wordpress
  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    ports:
      - "8000:80"
    restart: always
    volumes: ["./:/var/www/html"]
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_NAME: wordpress
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
    networks:
      - wpsite
networks:
  wpsite:
volumes:
  db_data:

Any help would be appreciated.

Thanks,

Ollie