MacOS - In file './docker-compose.yml', volume must be a mapping, not an array

admin

Administrator
Staff member
I've seen responses for similar errors, but nothing that seems to address a solution that will work for me.

I've got a wordpress site that I've imported into docker <a href="https://joshmobley.net/writing/2017/04/09/easy-wordpress-migration-with-docker.html" rel="nofollow noreferrer">following this tutorial</a>. I've got everything down to the final part where I'm supposed to "docker compose up" and I'm getting the error listed in the subject line. Here is my .yml file:

Code:
version: "2"

services:
    db:
        image: mysql:5.6
        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
        ports:
            - "8000:80"
        restart: always
        environment:
            WORDPRESS_DB_HOST: db:3306
            WORDPRESS_DB_USER: wordpress
            WORDPRESS_DB_PASSWORD: wordpress
        volumes:
            - ./public_html/wp-content/themes/oceanwp:/var/www/html/wp-content/themes/oceanwp
            - ./public_html/wp-content/plugins:/var/www/html/wp-content/plugins
            - ./public_html/wp-content/mu-plugins:/var/www/html/wp-content/mu-plugins
volumes:
    - ./data:/docker-entrypoint-initdb.d